Hi Michel,

svg-developers@yahoogroups.com wrote on 12/17/2005 04:11:33 PM:

> getBBox apply only to objects and not to group
> You can apply to your text or your rect not to container

   Sorry, but this wrong, where did you get this information?
"getBBox" applies to all elements that implement the 
'SVGLocatable' interface which certainly includes the 
'g' and 'svg' element.

> --- In svg-developers@yahoogroups.com, "rwkemper" <[EMAIL PROTECTED]> 
> wrote:

> > why does the code below not work with the rectangle in the group ??
> > In case I commented it out (as shown here , I get an x and y value 
> > by getBBox. In case it's active the result is 0 , 0 !!

   It does work you just need to understand the meaning of the values
returned. 'getBBox' returns the bounding box in the _userspace_ of the
element you call it on.  In this case the 'g' with 'id="x"'. 
The bounding box of the text and the rect is the rect's bounds (it
would appear that all the text lies within the rect).  The rects bounds
in the userspace of the 'g' is 0,0 -> 80,50.  So the x & y _should_ be
0,0.

> >       <g id="x" transform="translate(10,10)" >
> >          <text id="text1" x="20" y="50" fill="red" 
font-size="25">SVG</text>
> >          <!-- <rect x="0" y="0"   height="50" 
width="80" fill="red" 
> >                     stroke="none" /> -->
> >       </g>

   You may be interested in using the bbox in a seperate coordiate 
system like the parent of the g's coordinate system.  To do this
you may want to investigate methods like 'getTransformToElement'
or 'getScreenCTM'.  To get transforms between coordinate systems
which can be used to map the corners of your BBox to other 
coordinate systems.



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Most low income homes are not online. Make a difference this holiday season!
http://us.click.yahoo.com/5UeCyC/BWHMAA/TtwFAA/1U_rlB/TM
--------------------------------------------------------------------~-> 

-----
To unsubscribe send a message to: [EMAIL PROTECTED]
-or-
visit http://groups.yahoo.com/group/svg-developers and click "edit my 
membership"
---- 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/svg-developers/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to