From 1251dfd7f60612e6a99dcb48d6b4ea918d32adb9 Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Wed, 16 Oct 2024 09:25:32 +1000 Subject: [PATCH] feat(ui): better warnings when transforming --- .../CanvasEntity/CanvasEntityTransformer.ts | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/invokeai/frontend/web/src/features/controlLayers/konva/CanvasEntity/CanvasEntityTransformer.ts b/invokeai/frontend/web/src/features/controlLayers/konva/CanvasEntity/CanvasEntityTransformer.ts index 7de69dd5b8d..32e70607a3f 100644 --- a/invokeai/frontend/web/src/features/controlLayers/konva/CanvasEntity/CanvasEntityTransformer.ts +++ b/invokeai/frontend/web/src/features/controlLayers/konva/CanvasEntity/CanvasEntityTransformer.ts @@ -407,7 +407,9 @@ export class CanvasEntityTransformer extends CanvasModuleBase { */ fitToBboxFill = () => { if (!this.$isTransformEnabled.get()) { - this.log.warn('Cannot fit to bbox contain when transform is disabled'); + this.log.warn( + 'Cannot fit to bbox contain when transform is disabled. Did you forget to call `await adapter.transformer.startTransform()`?' + ); return; } const { rect } = this.manager.stateApi.getBbox(); @@ -428,7 +430,9 @@ export class CanvasEntityTransformer extends CanvasModuleBase { */ fitToBboxContain = () => { if (!this.$isTransformEnabled.get()) { - this.log.warn('Cannot fit to bbox contain when transform is disabled'); + this.log.warn( + 'Cannot fit to bbox contain when transform is disabled. Did you forget to call `await adapter.transformer.startTransform()`?' + ); return; } const { rect } = this.manager.stateApi.getBbox(); @@ -460,7 +464,9 @@ export class CanvasEntityTransformer extends CanvasModuleBase { */ fitToBboxCover = () => { if (!this.$isTransformEnabled.get()) { - this.log.warn('Cannot fit to bbox contain when transform is disabled'); + this.log.warn( + 'Cannot fit to bbox contain when transform is disabled. Did you forget to call `await adapter.transformer.startTransform()`?' + ); return; } const { rect } = this.manager.stateApi.getBbox(); @@ -687,6 +693,12 @@ export class CanvasEntityTransformer extends CanvasModuleBase { * Applies the transformation of the entity. */ applyTransform = async () => { + if (!this.$isTransforming.get()) { + this.log.warn( + 'Cannot apply transform when not transforming. Did you forget to call `await adapter.transformer.startTransform()`?' + ); + return; + } this.log.debug('Applying transform'); this.$isProcessing.set(true); this._setInteractionMode('off');