Raphael JS nested canvases?
I'm using Raphael JS to draw vector graphics on a webpage, and I have a rectangle (Raphael.rect) that I'd like to use as a seperate canvas from its parent. Is there any way to do this?
EDIT: I'd just draw in the rectangle like normal, but it wouldn't cut off the开发者_Python百科 contents at its border.
You currently can not use a Raphael rect
as the equivalent of a regular Raphael object: nesting is unfortunately not supported. What you will probably have to do is use the position of the rect
as an offset for all your drawing operations that should appear inside the rect
.
Apparently clip-rect works for this. Oh the power of searching after all hope is lost.
精彩评论