Hi Peppe,
Peppe <[EMAIL PROTECTED]> wrote on 12/09/2006 10:41:26 AM:
> Hi, i get bounding box of my shape but when i move the shape and i
reclick on
> shape the bounding box is calculated in old position, why?
Because the bounding box of an object is always given in it's
local coordinate system. Since you don't change the 'x','y' it's
bbox in the local coordiate system doesn't change. The transform
just changes the mapping from the local coordinate system to the screen.
> I move my shape creating a point by ctm Matrix and then i update
> attributeNS "transform" with SVG point values...
Then you need to transform the bbox to some other coordinate system
(like the screen or the root most SVG element). The following two
SVG DOM functions (on SVGLocatable) can be helpful for this:
SVGMatrix getScreenCTM ( );
SVGMatrix getTransformToElement ( in SVGElement element )
You can then use the SVGMatrix to map the corners of the bbox to
what ever coordinate system you want.