https://github.com/libsdl-org/SDL/commit/9a83fa026da182e127e77a69a2fdd5f3e170884e
From 9a83fa026da182e127e77a69a2fdd5f3e170884e Mon Sep 17 00:00:00 2001
From: expikr <[EMAIL REDACTED]>
Date: Mon, 13 Jan 2025 00:16:56 +0800
Subject: [PATCH] apply multiplier scale after system scale
---
include/SDL3/SDL_hints.h | 2 +-
src/events/SDL_mouse.c | 8 +++++---
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/include/SDL3/SDL_hints.h b/include/SDL3/SDL_hints.h
index 819a9704130ea..622297c042812 100644
--- a/include/SDL3/SDL_hints.h
+++ b/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.
diff --git a/src/events/SDL_mouse.c b/src/events/SDL_mouse.c
index 2ade6b800f7cd..bfdabb9fff224 100644
--- a/src/events/SDL_mouse.c
+++ b/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;