Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/intern
diff options
context:
space:
mode:
authorTon Roosendaal <ton@blender.org>2007-11-13 21:01:01 +0300
committerTon Roosendaal <ton@blender.org>2007-11-13 21:01:01 +0300
commitec686f581cb4ec588fa523e55d7fb08bea2a024c (patch)
tree577f79fb4886761217e72cde4e608f250bd0df3b /intern
parent1ece8b81cb72203fd5bc86fe068cec8a186b42e1 (diff)
Bugfix 7733
New mouse scrollwheels allowing higher precision didn't work in Windows. Code was assuming only value of +120 or -120 were returned.
Diffstat (limited to 'intern')
-rw-r--r--intern/ghost/intern/GHOST_SystemWin32.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/intern/ghost/intern/GHOST_SystemWin32.cpp b/intern/ghost/intern/GHOST_SystemWin32.cpp
index ec6d0d355b5..835f7da3038 100644
--- a/intern/ghost/intern/GHOST_SystemWin32.cpp
+++ b/intern/ghost/intern/GHOST_SystemWin32.cpp
@@ -54,7 +54,7 @@
#define WM_MOUSEWHEEL 0x020A
#endif // WM_MOUSEWHEEL
#ifndef WHEEL_DELTA
-#define WHEEL_DELTA 120 /* Value for rolling one detent */
+#define WHEEL_DELTA 120 /* Value for rolling one detent, (old convention! MS changed it) */
#endif // WHEEL_DELTA
@@ -479,7 +479,11 @@ GHOST_EventWheel* GHOST_SystemWin32::processWheelEvent(GHOST_IWindow *window, WP
{
// short fwKeys = LOWORD(wParam); // key flags
int zDelta = (short) HIWORD(wParam); // wheel rotation
- zDelta /= WHEEL_DELTA;
+
+ // zDelta /= WHEEL_DELTA;
+ // temporary fix below: microsoft now has added more precision, making the above division not work
+ if (zDelta <= 0 ) zDelta= -1; else zDelta= 1;
+
// short xPos = (short) LOWORD(lParam); // horizontal position of pointer
// short yPos = (short) HIWORD(lParam); // vertical position of pointer
return new GHOST_EventWheel (getSystem()->getMilliSeconds(), window, zDelta);