no, you don't need to wrap it in the group.
var myPath = document.getElementById('myPathid');
var bbox = myPath.getBBox();
alert(bbox.x+","+bbox.y+","+bbox.width+","+bbox.height);
should work just fine.
Are you perhaps testing it in MozillaSVG? If yes, you have to be aware that
there is a bug
that prevents using bounding boxes in functions called "onload". You have to
use a slight
delay and then it works fine. window.setTimeout() is your friend in this case.
Hopefully, this bug is fixed some day.
Andreas
--- In [email protected], "Sayed Arian Kooshesh" <[EMAIL
PROTECTED]> wrote:
>
> Hello,
> I'm trying to see if a path and rect intersect. I, cannot, however, get the
> bounding box of the path. I've attempting wrapping it in a g tag like this:
>
> var px = document.getElementById(path);
> var gNode = px.ownerDocument.createElementNS('
> http://www.w3.org/2000/svg','g');
> gNode.appendChild(px);
> var pathB = gNode.getBBox();
>
>
> but it always bugs out. can anyone help?
>
>
> [Non-text portions of this message have been removed]
>
-----
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/