Skip to content

Matrix2D not translating the same as previous versions #539

@mcfarljw

Description

@mcfarljw

I'm specifically referring to this commit and line:

p.translate = function(x, y) {

When I revert the translate method to what it was in previous versions things display correctly:

this.tx += x;
this.ty += y;

Here is the bit of code we're using, that given the same data input produces different matrix values between versions:

var ms = shape.getMatrix();
var sx = data.w / spriteBounds.width;
var sy = data.h / spriteBounds.height;
ms.scale(sx, sy);
ms.translate(-data.w / 2, -data.h / 2);
ms.rotate(data.rot * Math.PI / 180);

Any thoughts on why this might be happening?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions