Search code examples
javascriptsvgsvg-edit

Get the bounding box of a selected SVG element


I want to read:

  • width,height,x,y measurements

for a particular SVG element.


I suppose that easiest way to go about this is to fetch the minimum bounding box first and read it's properties.

How can I access this?


Solution

  • Assuming you have a handle to the element, I would think that this would work, no?

    box = svgedit.utilities.getBBox(selected);