ISSUE-2283

bbox-coord-system

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

State:
RAISED
Product:
SVG Core 2.0
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


Erik Dahlström <ed@opera.com>, Cameron McCormack <cam@mcc.id.au>, Chairs, Chris Lilley <chris@w3.org>, Doug Schepers <schepers@w3.org>, Staff Contacts
Tracker, originally developed by Dean Jackson, is developed and maintained by the Systems Team <w3t-sys@w3.org>.
$Id: index.php,v 1.231 2009/11/16 15:00:54 dom Exp $