Skip to content

Wrong 2d-matrix #21

@DevCybran

Description

@DevCybran

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 += ")";  
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions