Cleanup mouse wheel: Only call it if we have moves
authorDaniel Mehrmann <mehrmann>
Tue, 10 Feb 2004 23:37:25 +0000 (23:37 +0000)
committerDaniel Mehrmann <mehrmann>
Tue, 10 Feb 2004 23:37:25 +0000 (23:37 +0000)
winboard/winboard.c

index 69146fc..c000f95 100644 (file)
@@ -3112,11 +3112,14 @@ MouseEvent(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
        /* Mouse Wheel is being rolled forward \r
         * Play moves forward\r
         */\r
-       if((short)HIWORD(wParam) > 0 ) ForwardEvent();\r
-       /* Mouse Wheel is being rolled backward \r
-        * Play moves backward\r
-        */\r
-       if((short)HIWORD(wParam) < 0 ) BackwardEvent();\r
+       if ((short)HIWORD(wParam) > 0) \r
+          if (forwardMostMove > 0 && currentMove != forwardMostMove)\r
+                  ForwardEvent();\r
+          /* Mouse Wheel is being rolled backward \r
+           * Play moves backward\r
+           */\r
+       if ((short)HIWORD(wParam) < 0) \r
+          if (currentMove > 0) BackwardEvent();\r
        break;\r
   case WM_MBUTTONDOWN:\r
   case WM_RBUTTONDOWN:\r