Skip to content

Commit

Permalink
Fix incorrect hotspot calculation for cursor positioning
Browse files Browse the repository at this point in the history
Corrected the calculation of the vertical hotspot position in the `GetCachedCursor` function.

Changed the variable from `data->hot_x` to `data->hot_y` to ensure the correct vertical position of the cursor's hotspot is used when scaling.
  • Loading branch information
thouravi authored and slouken committed Jan 15, 2025
1 parent 8e9c44b commit 169c8d5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/video/windows/SDL_windowsmouse.c
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ static HCURSOR GetCachedCursor(SDL_Cursor *cursor)
}

int hot_x = (int)SDL_round(data->hot_x * scale);
int hot_y = (int)SDL_round(data->hot_x * scale);
int hot_y = (int)SDL_round(data->hot_y * scale);
hcursor = WIN_CreateHCursor(surface, hot_x, hot_y);
if (!hcursor) {
goto error;
Expand Down

0 comments on commit 169c8d5

Please sign in to comment.