Re: new SVGMatrix() should return the identity matrix

On Sat, Nov 30, 2013 at 11:07 PM, Eric Seidel <eseidel@chromium.org> wrote:

> Currently SVGMatrix() returns the zero matrix [1]
>
> Yet SVGTransform() returns an identity transform [2]
>
> CSSMatrix (when it was briefly specced [3] returned the identity as
> does WebKitCSSMatrix and I suspect MSCSSMatrix).
>

DOMMatrix will create an identity matrix when you use the simple
constructor [1].
There are no plans to release SVGMatrix.


>
> It seems to me it would make more sense for SVGMatrix() to return the
> identity matrix rather than the zero matrix.
>
> It's much more common that you would want to start with the entity and
> then modify it, rather than the zero matrix.
>
> For example: "(new SVGMatrix).scale(2)" seems totally reasonable, and
> would work perfectly if new SVGMatrix returned the identity.
>
>
> 1. http://www.w3.org/TR/SVG2/coords.html#InterfaceSVGMatrix
> 2. http://www.w3.org/TR/SVG2/coords.html#InterfaceSVGTransform
> 3. http://www.w3.org/TR/2011/WD-css3-2d-transforms-20111215/


1: http://dev.w3.org/fxtf/geometry/#dom-dommatrix-dommatrix

Received on Monday, 2 December 2013 23:11:12 UTC