Browse Source

apply multiplier scale after system scale

expikr 3 tháng trước cách đây
mục cha
commit
9a83fa026d
2 tập tin đã thay đổi với 6 bổ sung4 xóa
  1. 1 1
      include/SDL3/SDL_hints.h
  2. 5 3
      src/events/SDL_mouse.c

+ 1 - 1
include/SDL3/SDL_hints.h

@@ -2534,7 +2534,7 @@ extern "C" {
  * - "1": Relative mouse motion will be scaled using the system mouse
  *   acceleration curve.
  *
- * If SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE is set, that will apply before the
+ * If SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE is set, that will be applied after
  * system speed scale.
  *
  * This hint can be set anytime.

+ 5 - 3
src/events/SDL_mouse.c

@@ -669,13 +669,15 @@ static void SDL_PrivateSendMouseMotion(Uint64 timestamp, SDL_Window *window, SDL
 
     if (relative) {
         if (mouse->relative_mode) {
+            if (mouse->enable_relative_system_scale) {
+                if (mouse->ApplySystemScale) {
+                    mouse->ApplySystemScale(mouse->system_scale_data, timestamp, window, mouseID, &x, &y);
+                }
+            }
             if (mouse->enable_relative_speed_scale) {
                 x *= mouse->relative_speed_scale;
                 y *= mouse->relative_speed_scale;
             }
-            if (mouse->enable_relative_system_scale && mouse->ApplySystemScale) {
-                mouse->ApplySystemScale(mouse->system_scale_data, timestamp, window, mouseID, &x, &y);
-            }
         } else {
             if (mouse->enable_normal_speed_scale) {
                 x *= mouse->normal_speed_scale;