ISSUE-2283: Make it possible to get the bounding box of an element in a particular coordinate system

bbox-coord-system

Make it possible to get the bounding box of an element in a particular coordinate system

State:
RAISED
Product:
SVG 2
Raised by:
Cameron McCormack
Opened on:
2009-06-19
Description:
Sometimes you want to get the bounding box of an element in one of its ancestors' coordinate system. For example:

<g id="A" transform="...">
<g transform="...">
<path id="P" d="..."/>
</g>
</g>

Say if you want to click on the <path> and create a <rect> as a child of g#A that is shows the bounding box of the <path>. You need to:

* do bbox = P.getBBox()
* Construct SVGPoint objects for each of the four corners of bbox
* do m = P.getTransformToElement(A)
* Transform each of the four SVGPoints with m
* Compute the bounding box of these four points (a bunch of Math.min() and
Math.max() calls)
* Create the <rect> and set its x/y/width/height based on this computed bbox

It might be handy to be able to get the bounding box of an element in a particular element's coordinate system (possibly only an ancestor element?), possibly by supplying an SVGLocatable argument to getBBox().
Related Actions Items:
Related emails:
  1. Minutes, 01 July 2009 SVG WG telcon (from cam@mcc.id.au on 2009-07-01)
  2. Minutes, 01 July 2009 SVG WG telcon (from cam@mcc.id.au on 2009-07-01)
  3. Agenda, July 1 2009 SVG WG telcon (from ed@opera.com on 2009-06-30)
  4. Agenda, July 1 2009 SVG WG telcon (from ed@opera.com on 2009-06-30)
  5. Re: Agenda, June 24 2009 SVG WG telcon (from schepers@w3.org on 2009-06-23)
  6. Agenda, June 24 2009 SVG WG telcon (from ed@opera.com on 2009-06-23)
  7. ISSUE-2283 (bbox-coord-system): Make it possible to get the bounding box of an element in a particular coordinate system [SVG Core 2.0] (from sysbot+tracker@w3.org on 2009-06-19)

Related notes:

No additional notes.

Display change log ATOM feed


Dirk Schulze <dschulze@adobe.com>, Chair, Chris Lilley <chris@w3.org>, Staff Contact
Tracker: documentation, (configuration for this group), originally developed by Dean Jackson, is developed and maintained by the Systems Team <w3t-sys@w3.org>.
$Id: 2283.html,v 1.1 2020/01/17 13:20:56 carcone Exp $