Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
mvladic committed Nov 4, 2024
1 parent 5b62c01 commit 2ac342e
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions packages/project-editor/flow/editor/editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -341,10 +341,8 @@ export const Canvas = observer(

const flowContext = this.props.flowContext;

const deltaX =
Math.abs(event.deltaX) < 5 ? event.deltaX : event.deltaX / 5;
const deltaY =
Math.abs(event.deltaY) < 5 ? event.deltaY : event.deltaY / 5;
const deltaX = event.deltaX;
const deltaY = event.deltaY;

if (
event.altKey &&
Expand Down Expand Up @@ -629,7 +627,13 @@ export const Canvas = observer(
this.mouseHandler = new PanMouseHandler();
}
} else {
this.mouseHandler = this.createMouseHandler(event);
if (event.altKey) {
if (!this.mouseHandler) {
this.mouseHandler = new PanMouseHandler();
}
} else {
this.mouseHandler = this.createMouseHandler(event);
}
}

if (this.mouseHandler) {
Expand Down

0 comments on commit 2ac342e

Please sign in to comment.