]> gitweb.factorcode.org Git - factor.git/commitdiff
ui.backend.windows: fix mouse-scroll implementation
authorAlexander Ilin <alex.ilin@protonmail.com>
Sun, 25 Feb 2024 14:56:26 +0000 (15:56 +0100)
committerJohn Benediktsson <mrjbq7@gmail.com>
Sun, 25 Feb 2024 17:24:44 +0000 (09:24 -0800)
The lo-word should be ignored: it contains flags that should not affect the
scroll direction vector.

basis/ui/backend/windows/windows.factor

index 9dba6fed9295848eb153a0bbf2bb72f9ab7590c3..f2a37f58d35cf8578fdac3bdd76a8553e71f3f9e 100644 (file)
@@ -436,8 +436,8 @@ SYMBOL: nc-buttons
     message>button nc-buttons get
     swap [ push ] [ remove! drop ] if ;
 
-: mouse-scroll ( wParam -- array )
-    >lo-hi [ -80 /f ] map ;
+: mouse-scroll ( wParam -- direction )
+    hi-word -80 /f 0 swap 2array ;
 
 : mouse-horizontal-scroll ( wParam -- direction )
     hi-word 80 /f 0 2array ;