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:
- ACTION-2629 on Cameron McCormack to Add a proposal for getBBoxOf() to the proposals directory - due 2009-07-08, open
- Related emails:
- Minutes, 01 July 2009 SVG WG telcon (from cam@mcc.id.au on 2009-07-01)
- Minutes, 01 July 2009 SVG WG telcon (from cam@mcc.id.au on 2009-07-01)
- Agenda, July 1 2009 SVG WG telcon (from ed@opera.com on 2009-06-30)
- Agenda, July 1 2009 SVG WG telcon (from ed@opera.com on 2009-06-30)
- Re: Agenda, June 24 2009 SVG WG telcon (from schepers@w3.org on 2009-06-23)
- Agenda, June 24 2009 SVG WG telcon (from ed@opera.com on 2009-06-23)
- 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