Browse Source

wayland: Always use integer scaling for cursors.

Cursors don't get fractionally scaled, so always scale system cursor sizes to the next whole integer.
Frank Praznik 2 years ago
parent
commit
903301c6aa
1 changed files with 4 additions and 2 deletions
  1. 4 2
      src/video/wayland/SDL_waylandmouse.c

+ 4 - 2
src/video/wayland/SDL_waylandmouse.c

@@ -199,8 +199,10 @@ wayland_get_system_cursor(SDL_VideoData *vdata, Wayland_CursorData *cdata, float
         return SDL_FALSE;
         return SDL_FALSE;
     }
     }
     focusdata = focus->driverdata;
     focusdata = focus->driverdata;
-    *scale = focusdata->scale_factor;
-    size *= focusdata->scale_factor;
+
+    /* Cursors use integer scaling. */
+    *scale = SDL_ceilf(focusdata->scale_factor);
+    size *= *scale;
     for (i = 0; i < vdata->num_cursor_themes; i += 1) {
     for (i = 0; i < vdata->num_cursor_themes; i += 1) {
         if (vdata->cursor_themes[i].size == size) {
         if (vdata->cursor_themes[i].size == size) {
             theme = vdata->cursor_themes[i].theme;
             theme = vdata->cursor_themes[i].theme;