Skip to content

Commit

Permalink
Change order of rotation
Browse files Browse the repository at this point in the history
  • Loading branch information
MadeByMike committed Oct 30, 2023
1 parent eeca597 commit 63924bc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/shapes/Transformer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1056,17 +1056,19 @@ export class Transformer extends Group {
oldTr.scale(oldAttrs.width / baseSize, oldAttrs.height / baseSize);

const newTr = new Transform();
newTr.rotate(newAttrs.rotation);
const newScaleX = newAttrs.width / baseSize;
const newScaleY = newAttrs.height / baseSize;

if (this.flipEnabled() === false) {
newTr.translate(
newAttrs.x + (newAttrs.width < 0 ? newAttrs.width : 0),
newAttrs.y + (newAttrs.height < 0 ? newAttrs.height : 0)
);
newTr.rotate(newAttrs.rotation);
newTr.scale(Math.abs(newScaleX), Math.abs(newScaleY));
} else {
newTr.translate(newAttrs.x, newAttrs.y);
newTr.rotate(newAttrs.rotation);
newTr.scale(newScaleX, newScaleY);
}

Expand Down

0 comments on commit 63924bc

Please sign in to comment.