From d99ae5800195e6752730a583003bf39ec71c1f2a Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Fri, 2 Aug 2024 18:32:04 +1000 Subject: [PATCH] fix(ui): unable to hold shit while transforming to retain ratio --- .../src/features/controlLayers/konva/CanvasTransformer.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/invokeai/frontend/web/src/features/controlLayers/konva/CanvasTransformer.ts b/invokeai/frontend/web/src/features/controlLayers/konva/CanvasTransformer.ts index 303f60ecd2..81711a479d 100644 --- a/invokeai/frontend/web/src/features/controlLayers/konva/CanvasTransformer.ts +++ b/invokeai/frontend/web/src/features/controlLayers/konva/CanvasTransformer.ts @@ -150,6 +150,11 @@ export class CanvasTransformer { return { x: scaledTargetX, y: scaledTargetY }; }, boundBoxFunc: (oldBoundBox, newBoundBox) => { + // Bail if we are not rotating, we don't need to do anything. + if (this.konva.transformer.getActiveAnchor() !== 'rotater') { + return newBoundBox; + } + // This transform constraint operates on the bounding box of the transformer. This box has x, y, width, and // height in stage coordinates, and rotation in radians. This can be used to snap the transformer rotation to // the nearest 45 degrees when shift is held.