W3C home > Mailing lists > Public > whatwg@whatwg.org > March 2014

[whatwg] Singular CTM and currentTransform

From: Dirk Schulze <dschulze@adobe.com>
Date: Tue, 25 Mar 2014 15:25:46 +0000
To: whatwg <whatwg@lists.whatwg.org>
Message-ID: <ABDD7FC0-C555-4ABB-B6FB-7303D09C4BAE@adobe.com>
Hi,

Independent if getter getTransform/getCTM or attribute currentTransform, what should be returned for a CTM that is singular (not invertible)?

In WebKit we do not track all transformations of the CTM that caused a singular matrix or are following a transformation that would have caused a singular matrix.

Example:

ctx.scale(0,0);
ct.translate(10,10);

In webkit we would not apply the transformation scale(0,0) and mark the CTM as not-invertible instead. So we could not return an SVGMatrix object with a = b = c = d = 0; e = f = 10 because we actually donít know the CTM after applying all transforms.

I would suggest that the getter either:
1) throws and invalid state error if the CTM is not invertible
2) returns 0. In WebIDLit would look like: SVGMatrix? getTransform(); 

Greetings,
Dirk

PS: This is one reason I prefer a getter over an attribute because the getter does not return a mutable (live) SVGMatrix. But even than the problem above is not fully solved of course.
Received on Tuesday, 25 March 2014 15:26:13 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 17:00:17 UTC