W3C home > Mailing lists > Public > public-webapps@w3.org > October to December 2011

Re: Proposal for a new Matrix API

From: Cameron McCormack <cam@mcc.id.au>
Date: Fri, 21 Oct 2011 14:04:50 -0400
Message-ID: <4EA1B442.7050209@mcc.id.au>
To: Igor Oliveira <igor.oliveira@openbossa.org>
CC: public-webapps@w3.org
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.


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

This archive was generated by hypermail 2.3.1 : Friday, 27 October 2017 07:26:36 UTC