ISSUE-2302 (Object transforms effect on Gradients): How gradients are transformed by an object transform is unclear [SVG Core 2.0]

ISSUE-2302 (Object transforms effect on Gradients): How gradients are transformed by an object transform is unclear [SVG Core 2.0]

http://www.w3.org/Graphics/SVG/WG/track/issues/2302

Raised by: Anthony Grasso
On product: SVG Core 2.0

The wording in SVG Tiny 1.2 is very ambiguous regarding the gradient vector and when it is transformed.
http://www.w3.org/TR/SVGTiny12/painting.html#LinearGradientElement#LinearGradientUnitsAttribute

[[
If gradientUnits="userSpaceOnUse", 'x1', 'y1', 'x2', 'y2' shall represent values in the coordinate system that results from taking the current user coordinate system in place at the time when the gradient element is referenced"
]]

A gradient direction is defined by the vector, but there is a second component which defines the direction of the stripes on a linear gradient - the Gradient Normal. Information on how the normal is used for rendering linear gradients needs to be added to the SVG specifications. 

The problem is at what point in time the gradient normal is transformed. >From a technical perspective the two different results can be achieved both of which are correct.

Implementation 'A' defines a Gradient Vector and a Gradient Normal prior to being transformed. When the transformation is applied both vector and normal are transformed.

Implementation 'B' defines a Gradient Vector only prior to being transformed. When the transform is applied the vector is transformed. The normal is then defined on the gradientprior to any gradientTransform attributes being applied.

Given that the specification is ambiguous about the 'time' a gradient element is reference and additionally does not define how a gradient normal works with a gradient vector both implementations are technically correct. The question then remains which method would look better for authoring.

Received on Thursday, 28 January 2010 05:41:12 UTC