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

Re: SVG 1.1 Spec Rec - 7.6 The Transform Attribute

From: Thomas DeWeese <Thomas.DeWeese@Kodak.com>
Date: Wed, 26 Jan 2005 08:48:29 -0500
Message-ID: <41F79FAD.1040801@Kodak.com>
To: Ian Brown <ianbrown@istar.ca>
CC: www-svg@w3.org

Hi Ian,

    The basic problem is that the transform attribute describes the
transformation from one coordinate system to another not the
transformation of the geometry (this would be problematic as it
wouldn't work for groups).

    I'll go through your example using the coordinate system not
the geometry.

Ian Brown wrote:

> Take a rectangle at (0,0) of width and height 30.

    Take an inital coordinate system (C1)

> Translate it to (200, 0)
> We then have a rectangle at (200, 0) of width and height 30.

    Create a new coordinate system (C2) translated by 200,0.  We now
have a coordinate system with it's origin at location 200,0 in
the original coordinate system (C1).

> Now rotate that rectangle by 45 degrees (about 0,0). 

    Now create another new coordinate system (C3) by rotating the
cooridinate system (C2) by 45 degrees around it's origin, which is
at location 200,0 in the original coordinate system (C1).

>(remember the rectangle now has an upper left at 200,0 and lower right at 230,30)
> What do we expect? We expect the upper left and upper right points of 
> the square to lie along the 45 diagonal passing through 0,0
> i.e. the rotation is about 0,0 not 200,0. The upper left conner will be 
> a distance of 200 from 0,0.

    Now define a rectangle in the final coordinate system (C3), such
that it starts at 0,0 and has a width/height of 30.

> That is not what Adobe SVG or Amaya does.

    The above is what Adobe, Amaya, Batik, and Mozilla do.
Please see the attached SVG that illustrates the coordinate
systems involved.

> The spec should not be compromised by the implementation.
> Interpreting the spec according to "matrix order rules" (backwards to 
> English?) is interpreting the spec based on using a matrix based 
> implementation. This is highly confusing, and inappropriate.
> Further since the matrix order for pre-concatenation is opposite to 
> post-concatenation the spec would have specify pre or post rules.

    The problem is that you are trying to apply the transformation
to the geometry not to the coordinate system.  The transform attribute
defines the coordinate system that the rectangles coordinates are
evaluated in it does not define a transformation of the rectangle.


<svg width="400" height="400"
      viewBox="-20 -20 390 390">

    <symbol id="axis" stroke-width="2"
            viewBox="0 0 100 100" overflow="visible"
            stroke-linecap="round" >
           <line x1="0" y1="0" x2="90" y2="0"/>
           <line x1="0" y1="0" x2="0"  y2="90"/>
           <path d="M0 100 l3-10 h-6z" stroke="none"/>
           <path d="M100 0 l-10,3 v-6z" stroke="none"/>

    <g stroke="black" fill="black">
       <use x="0" y="0" width="300" height="300"
       <text x="10" y="30" font-size="20" stroke="none">C1</text>

    <g transform="translate(200, 0)" stroke="blue" fill="blue">
       <use x="0" y="0" width="300" height="300"
       <text x="50" y="30" font-size="20" stroke="none">C2</text>

    <g transform="translate(200, 0) rotate(45)"
       stroke="green" fill="green">
       <use x="0" y="0" width="300" height="300"
       <text x="50" y="30" font-size="20" stroke="none">C3</text>

       <rect x="0" y="0" width="30" height="30"
             fill="purple" fill-opacity="0.5"/>
Received on Wednesday, 26 January 2005 13:48:32 UTC

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