Explorar o código

Fix scroll wheel handling in testmouse

Cameron Cawley %!s(int64=2) %!d(string=hai) anos
pai
achega
df05d5eff4
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      test/testmouse.c

+ 2 - 2
test/testmouse.c

@@ -125,10 +125,10 @@ static void loop(void *arg)
                 /* "positive to the right and negative to the left"  */
                 /* "positive to the right and negative to the left"  */
                 wheel_x += event.wheel.x * 10.0f;
                 wheel_x += event.wheel.x * 10.0f;
             }
             }
-            if (event.wheel.x != 0.0f) {
+            if (event.wheel.y != 0.0f) {
                 wheel_y_active = SDL_TRUE;
                 wheel_y_active = SDL_TRUE;
                 /* "positive away from the user and negative towards the user" */
                 /* "positive away from the user and negative towards the user" */
-                wheel_y -= event.wheel.x * 10.0f;
+                wheel_y -= event.wheel.y * 10.0f;
             }
             }
             break;
             break;