RE: [svg-developers] getBBox of a stroked object

I'm forwarding this discussion to the SVG Working Group, in hopes that
something like getStrokedBBox() could be added to SVG 2.0.
There are times that one would want to know the actual footprint of
something with its stroke. Apologies if this has already been discussed here
-- I seem to recall a thread, but a scan of the last few months of the
archives didn't reveal it.

(see the example at http://granite.sru.edu/~ddailey/svg/B/bbox2.3.svg )

Regards
David

-----Original Message-----
From: svg-developers@yahoogroups.com [mailto:svg-developers@yahoogroups.com]
On Behalf Of Jeff Schiller
Sent: Saturday, September 17, 2011 10:59 AM
To: svg-developers@yahoogroups.com
Subject: Re: [svg-developers] getBBox of a stroked object

svg-edit uses its own getStrokedBBox() function:

http://code.google.com/p/svg-edit/source/browse/trunk/editor/svgcanvas.js#64
5

which, as you say, was non-trivial.

Jeff

On Sat, Sep 17, 2011 at 7:11 AM, David Dailey
<ddailey@zoominternet.net>wrote:

> **
>
>
> I'm certain this topic has been discussed before (perhaps even by me), so
> please forgive any duplication. In the example at
> http://granite.sru.edu/~ddailey/svg/B/bbox2.3.svg the bounding box around
> the curve (as drawn by script) does not factor in the stroke-width. Is
> there
> a method that does this? Given that the bounds of the stroke will be
> parallel to the curve itself and I assume (though I don't see instructions
> in the spec [1] ) that offsets are determined by lines perpendicular to
> tangents to the curve at its endpoints, calculating the actual bounding
box
> might not be an easy scripting exercise.
>
> Thanks in advance
>
> David
>
> [1] http://www.w3.org/TR/SVG/painting.html#StrokeProperties
>

<*> To change settings via email:
    svg-developers-digest@yahoogroups.com 
    svg-developers-fullfeatured@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
    svg-developers-unsubscribe@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

Received on Saturday, 17 September 2011 15:48:33 UTC