Skip to content

Commit

Permalink
SDL_HINT_MOUSE_RELATIVE_SYSTEM_SCALE can be combined with SDL_HINT_MO…
Browse files Browse the repository at this point in the history
…USE_RELATIVE_SPEED_SCALE
  • Loading branch information
slouken committed Jan 12, 2025
1 parent 95c1584 commit 551510c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
3 changes: 1 addition & 2 deletions include/SDL3/SDL_hints.h
Original file line number Diff line number Diff line change
Expand Up @@ -2534,8 +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 override the
* system speed scale.
* If SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE is set, that will apply before the system speed scale.
*
* This hint can be set anytime.
*
Expand Down
7 changes: 3 additions & 4 deletions src/events/SDL_mouse.c
Original file line number Diff line number Diff line change
Expand Up @@ -672,10 +672,9 @@ static void SDL_PrivateSendMouseMotion(Uint64 timestamp, SDL_Window *window, SDL
if (mouse->enable_relative_speed_scale) {
x *= mouse->relative_speed_scale;
y *= mouse->relative_speed_scale;
} else if (mouse->enable_relative_system_scale) {
if (mouse->ApplySystemScale) {
mouse->ApplySystemScale(mouse->system_scale_data, timestamp, window, mouseID, &x, &y);
}
}
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) {
Expand Down

0 comments on commit 551510c

Please sign in to comment.