Skip to content

Commit

Permalink
fix scrolling issue within LVGL widget (ALT+wheel)
Browse files Browse the repository at this point in the history
  • Loading branch information
mvladic committed Nov 4, 2024
1 parent 8e531e2 commit f068dc5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/project-editor/flow/editor/editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -341,8 +341,10 @@ export const Canvas = observer(

const flowContext = this.props.flowContext;

const deltaX = event.deltaX;
const deltaY = event.deltaY;
console.log(event.deltaX, event.deltaY);

let deltaX = event.deltaX;
let deltaY = event.deltaY;

if (
event.altKey &&
Expand Down Expand Up @@ -370,6 +372,9 @@ export const Canvas = observer(
) != -1 &&
lvglWidget.children.length > 0
) {
if (Math.abs(deltaX) == 100) deltaX /= 5;
if (Math.abs(deltaY) == 100) deltaY /= 5;

let xScroll =
lvglWidget._xScroll2 +
(event.shiftKey ? deltaY : deltaX);
Expand Down

0 comments on commit f068dc5

Please sign in to comment.