W3C home > Mailing lists > Public > www-svg@w3.org > January 2010

RE: Fwd: getBBox() on a <use>

From: Patrick Dengler <patd@microsoft.com>
Date: Fri, 29 Jan 2010 15:02:06 +0000
To: www-svg <www-svg@w3.org>
Message-ID: <4A2DB3AE4504E944AF122BBFBA7FBA1F3E7B1D83@TK5EX14MBXC112.redmond.corp.microsoft.com>
Sorry to be the late to the game on this one, I thought I would add more confusion or perhaps ask an already answered question :)

Should SVGLocatable.getBBox return a read-only SVGRect? 

You obviously cannot modify the bounding box of an element by modifying the rectangle. Making it readonly would allow implementations to store a cached result without fear of the value being changed by callers.

Thanks in advance,

Patrick Dengle

-----Original Message-----
From: www-svg-request@w3.org [mailto:www-svg-request@w3.org] On Behalf Of Boris Zbarsky
Sent: Wednesday, January 20, 2010 12:53 PM
To: Jeff Schiller
Cc: www-svg
Subject: Re: Fwd: getBBox() on a <use>

On 1/20/10 3:47 PM, Jeff Schiller wrote:
> The confusing part is that<g>  does not have x,y,width,height
> attributes, while<use>  does, implying that the<use>  imposes a given
> box in the user coordinate system beyond just its referenced/shadowed
> content.

Yep.

> I realize that it's too late to change things in SVG 1.1 and SVGT 1.2,
> but I'm curious why would it be useful for getBBox() on a<use>
> element to return the bounding box of the referenced content and not
> take into account the position/scaling imposed by the surrounding use
> element's x,y,width,height?

I have no idea, honestly.  But then again, the behavior of getBBox() 
generally seems to be ... somewhat odd (given the user coordinate system 
thing).

> For instance, I could have six<use>  elements all pointing to the same
> element - yet all six<use>  bboxes would be identical.

I'm not sure they necessarily would if the element used percent sizes, 
would they?

-Boris
Received on Friday, 29 January 2010 15:02:43 GMT

This archive was generated by hypermail 2.3.1 : Friday, 8 March 2013 15:54:44 GMT