From f068dc5b706470fc65bfa92f4bac4288006fb90b Mon Sep 17 00:00:00 2001 From: Martin Vladic Date: Mon, 4 Nov 2024 23:58:33 +0100 Subject: [PATCH] fix scrolling issue within LVGL widget (ALT+wheel) --- packages/project-editor/flow/editor/editor.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/project-editor/flow/editor/editor.tsx b/packages/project-editor/flow/editor/editor.tsx index 51adc43c..36a6f1c5 100644 --- a/packages/project-editor/flow/editor/editor.tsx +++ b/packages/project-editor/flow/editor/editor.tsx @@ -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 && @@ -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);