W3C home > Mailing lists > Public > www-svg@w3.org > June 2005

getBBox and the transform attribute

From: Rob Adams <readams@readams.net>
Date: Tue, 07 Jun 2005 15:19:09 -0700
To: www-svg@w3.org
Message-Id: <1118182750.2376.8.camel@localhost.localdomain>

According to http://www.w3.org/TR/SVG/types.html#InterfaceSVGLocatable,
getBBox "Returns the tight bounding box in current user space (i.e.,
after application of the transform attribute, if any) on the geometry of
all contained graphics elements, exclusive of stroke-width and filter

Consider this document:
<svg id="drawingCanvas" version="1.1"
	 viewPort="0 0 300 400"
	 xmlns = "http://www.w3.org/2000/svg">
  <rect id="transformed" fill="blue" stroke="black" stroke-width="3"
	 x="100" y="100" width="100" height="200"transform="translate(50 50)"/>
  <rect id="untransformed" fill="none" stroke="black" stroke-width="1"
         stroke-dasharray="4,4" x="100" y="100" width="100" height="200"/>

Adobe, Batik, and mozilla SVG all seem to show the behavior that for
both of these rect, getBBox returns (100, 100, 100, 200) and not (150,
150, 100, 200) for the transformed rectangle.

The question is, given the ambiguity of the spec, is this behavior


and the testcase at:

(Note that in order for this work you must be using a recent nightly
build of firefox)
Received on Wednesday, 8 June 2005 01:14:10 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 March 2017 09:47:03 UTC