Bounding Box Calculation

Using ASV3, I noticed that:
		width="800" height="600"
		viewBox="0 0 800 600"
			<rect x="-100" y="-100" width="1200" height="1200">
results in '1200' and not '800' being alerted.

The SVG 1.1 specs don't seem to explicitly cover how to compute the 
bounding box depending on the value of the overflow style, but they 
generally indicate a simple calculation method which could be 
interpreted to exclude this property.

	"The bounding box is computed exclusive of any values for clipping, 
	filter effects, opacity and stroke-width."

It is my (rather strong) opinion that such a calculation technique, 
while convenient for the UA developers, makes the bounding box rather 
pointless. Using:
should include child elements who stray outside the viewBox in the 
bounding box calculations, but
should not. Similarly, if I have
	<g><circle ... r="10" style="stroke-width:200"/></g>
then the bounding box width is '220' IMO. Handing me '20' is of little 

The SVG 1.2 draft mentions the possibility of such an improvement:

	"In order to provide greater flexibility and expressive power, it 
might make sense
	to simultaneously add new utility methods in the SVG DOM, such as 
	in area of geometry queries (e.g., bounding box queries that take into 
account things
	such as stroke widths and filter effects)."

and I would heartily encourage the changing of the word 'might' to 
'definitely'. :)

If you don't want to break existing 1.1 scripts, then perhaps the 
addition of
might be in order.
Gavin Kistner @ Refinery, Inc.
work: +1.303.444.1777
cell: +1.303.641.1521

Received on Tuesday, 30 September 2003 11:13:35 UTC