From 66754f6031436b22e93a11ced4177a0d456c0528 Mon Sep 17 00:00:00 2001 From: Martin Vladic Date: Fri, 27 Sep 2024 10:25:19 +0200 Subject: [PATCH] #498 --- .../project-editor/flow/runtime-viewer/viewer.tsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/project-editor/flow/runtime-viewer/viewer.tsx b/packages/project-editor/flow/runtime-viewer/viewer.tsx index 88f6e63d..7e9953e4 100644 --- a/packages/project-editor/flow/runtime-viewer/viewer.tsx +++ b/packages/project-editor/flow/runtime-viewer/viewer.tsx @@ -201,7 +201,7 @@ export const Canvas = observer( } onWheel = (event: WheelEvent) => { - if (event.buttons === 4 || this.props.flowContext.frontFace) { + if (event.buttons === 4) { // do nothing if mouse wheel is pressed, i.e. pan will be activated in onMouseDown return; } @@ -235,13 +235,20 @@ export const Canvas = observer( ((y - transform.translate.y) * scale) / transform.scale; transform.scale = scale; - transform.translate = { x: tx, y: ty }; + + if (!this.props.flowContext.frontFace) { + transform.translate = { x: tx, y: ty }; + } runInAction(() => { this.props.flowContext.viewState.transform = transform; }); } } else { + if (this.props.flowContext.frontFace) { + return; + } + transform.translate = { x: transform.translate.x -