Re: Proposal for a new Matrix API

On 20/10/11 10:39 AM, Igor Oliveira wrote:
> Currently CSSMatrix and SVGMatrix has an immutable API. None of the
> method calls change the Matrix, instead, it creates a new Matrix with
> the changed value. It can be a problem specially when CSSMatrix is
> used together with WebGL. [1]

SVGMatrix is not immutable.  You can modify the a, b, ..., f properties.

http://www.w3.org/TR/SVG/coords.html#InterfaceSVGMatrix

However the methods that perform operations do return new matrices 
rather than modifying the one the method is called on.

> We from WebKit are proposing a new Matrix API(simple as possible), see
> below or [2], where the standard methods change the matrix(in place
> operations) and additional methods (multipliedBy, scaledBy and so on)
> create a new Matrix as is done by CSSMatrix and SVGMatrix.
>
> The idea is make this class accepted where CSSMatrix and SVGMatrix is
> used and be the preferred class for all Matrix needs. [3]

I agree that unifying CSSMatrix/SVGMatrix is a good idea, if that is 
possible.  Will look at your specific proposal a bit later.

Received on Friday, 21 October 2011 18:05:33 UTC