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

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

From: Jeff Schiller <codedread@gmail.com>
Date: Fri, 29 Jan 2010 09:23:13 -0600
Message-ID: <da131fde1001290723y21721511v4faf43e0d53752cc@mail.gmail.com>
To: Patrick Dengler <patd@microsoft.com>
Cc: www-svg <www-svg@w3.org>
As far as I knew, SVGRect is not 'live' - that is, it's a lightweight
object that could contain a bbox or it just could contain some other
rect that the user wants to work with.  Users could change the
x,y,width,height of a SVGRect and this has no effect on the DOM
element that it might have come from.

You can also create a SVGRect on its own via the SVGSVGElement method
createSVGRect() which also returns a similar lightweight object.

Regards,
Jeff

On Fri, Jan 29, 2010 at 9:02 AM, Patrick Dengler <patd@microsoft.com> wrote:
> 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:23:50 GMT

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