On Thu, Jun 5, 2014 at 2:14 PM, Dirk Schulze <dschu...@adobe.com> wrote:

>
> On Jun 5, 2014, at 11:07 PM, Rik Cabanier <caban...@gmail.com> wrote:
>
> > It seems like we're getting to agreement. (Please tell me if I'm wrong
> about this)
> > There are 2 things that I have questions about:
> > 1. isIdentity()
> > We settled that this should mean that the matrix was never changed to a
> non identity state.
> > This means that the following code:
> > var m = new DOMMatrix();
> > m.rotate(0);
> > m.isIdentity() == false; //!
> > Given this, I feel that maybe we should rename it to hasChanged or
> isInitial,
>
> How would that be useful for authors? hasChanged or isInital wouldn’t
> reveal any information.


It would. For instance:

var m = getMatrixFromCSSOM();

if(m.hasChanged())

....; // apply matrix



> The idea of isIdentity is to know if the transformation matrix will have
> any effect. If we should not be able to check this then it should
> definitely not be named isIdentity but more over: it seems to be irrelevant.


Benoit already went over this earlier in this thread:

The isIdentity() method has the same issue as was described about is2D()
above: as matrices get computed, they are going to jump unpredicably
between being exactly identity and not. People using isIdentity() to jump
between code paths are going to get unexpected jumps between code paths
i.e. typically performance cliffs, or worse if they start asserting that a
matrix should or should not be exactly identity. For that reason, I would
remove the isIdentity method.


>
> > 2. xxxby
> > DOMMatrix contains a bunch of xxxby methods (ie translateBy, rotateBy)
> that apply the transformation to the object itself.
> > Benoit was confused by it and I agree that the name is not ideal. Should
> we rename it to "InPlace’ ?
>
> It is less likely that authors are willing to write translateInPlace then
> translateBy IMO.
>

translateMe ?
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to