From 63924bceee247ad2aacedc2861f0c15edcb6800e Mon Sep 17 00:00:00 2001 From: Mike Date: Mon, 30 Oct 2023 21:28:41 +0000 Subject: [PATCH] Change order of rotation --- src/shapes/Transformer.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/shapes/Transformer.ts b/src/shapes/Transformer.ts index 72090f94..b79ff0e4 100644 --- a/src/shapes/Transformer.ts +++ b/src/shapes/Transformer.ts @@ -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); }