Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
mvladic committed Sep 27, 2024
1 parent decdca4 commit 66754f6
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions packages/project-editor/flow/runtime-viewer/viewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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 -
Expand Down

0 comments on commit 66754f6

Please sign in to comment.