Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong 2d-matrix #21

Open
DevCybran opened this issue May 5, 2012 · 0 comments
Open

Wrong 2d-matrix #21

DevCybran opened this issue May 5, 2012 · 0 comments

Comments

@DevCybran
Copy link

Currently, the 2d-matrix is built by the following code:

  if (supports2d) {
    s  = "matrix(";
      s += tM.e(1,1).toFixed(10) + "," + tM.e(1,2).toFixed(10) + ",";
      s += tM.e(2,1).toFixed(10) + "," + tM.e(2,2).toFixed(10) + ",";
      s += tM.e(3,1).toFixed(10) + "px," + tM.e(3,2).toFixed(10)+'px';
    s += ")";        
  }

This is not absolutely correct, since the suffix "px" in two last attributes is only supported by firefox (property MozTransform). All other browsers are expecting a matrix without any unit, ignoring any matrix that is built with a unit inside.
The corrected code (for other browsers only):

  if (supports2d) {
    s  = "matrix(";
      s += tM.e(1,1).toFixed(10) + "," + tM.e(1,2).toFixed(10) + ",";
      s += tM.e(2,1).toFixed(10) + "," + tM.e(2,2).toFixed(10) + ",";
      s += tM.e(3,1).toFixed(10) + "," + tM.e(3,2).toFixed(10);
    s += ")";  
  }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant