Get a BBox from Raphael's Object Group?

What is the best way to get the bounding box of several Raphael objects in general?

Can I put them all in set and call mySet.getBBox() ?

Or do I need to skip them all, get a bbox for each of them, and calculate the total height and width?

(Also, I cannot use SVG directly - I need VML support.)

+8
javascript svg raphael vml
source share
1 answer

E. It is very easy. (Thanks @Dylan):

 var paper = Raphael ('test', 100, 100); var circles = paper.set(); var c1 = paper.circle(70,30,10); var c2 = paper.circle(50,10,10); var c3 = paper.circle(10,80,10); circles.push(c1, c2, c3); alert(c3.getBBox().width); // --> 20 alert(circles.getBBox().width); // --> 80 
+11
source share

All Articles