From 8d6996cdf07abbd0c72aed1fa5643b6590cdd384 Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Wed, 9 Oct 2024 12:00:51 +1000 Subject: [PATCH] fix(ui): sync pointer position on pointerdown There's a Konva bug where `pointerenter` & `pointerleave` events aren't fired correctly on the stage. In 87fdea4cc65f70b4890e52089916751d479059f0 I made a change that surfaced this bug, breaking touch and Apple Pencil interactions, because the cursor position doesn't get updated. Simple fix - ensure we update the cursor on `pointerdown` events, even though we shouldn't need to. Will make a bug report upstream --- .../features/controlLayers/konva/CanvasTool/CanvasToolModule.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/invokeai/frontend/web/src/features/controlLayers/konva/CanvasTool/CanvasToolModule.ts b/invokeai/frontend/web/src/features/controlLayers/konva/CanvasTool/CanvasToolModule.ts index 257fa868be..080ab757f5 100644 --- a/invokeai/frontend/web/src/features/controlLayers/konva/CanvasTool/CanvasToolModule.ts +++ b/invokeai/frontend/web/src/features/controlLayers/konva/CanvasTool/CanvasToolModule.ts @@ -395,6 +395,7 @@ export class CanvasToolModule extends CanvasModuleBase { const isMouseDown = getIsPrimaryMouseDown(e); this.$isMouseDown.set(isMouseDown); + this.syncCursorPositions(); const cursorPos = this.$cursorPos.get(); const tool = this.$tool.get(); const settings = this.manager.stateApi.getSettings();