surface: SDL_RotateSurface should update SDL_PROP_SURFACE_ROTATION_FLOAT.

Fixes #14616.
This commit is contained in:
Ryan C. Gordon
2025-12-07 15:27:36 -05:00
parent 4194879df1
commit 5813d0ec0a
2 changed files with 16 additions and 0 deletions

View File

@@ -2198,6 +2198,14 @@ SDL_Surface *SDL_RotateSurface(SDL_Surface *surface, float angle)
SDL_DestroySurface(convert);
}
}
if (rotated) {
if (SDL_HasProperty(surface->props, SDL_PROP_SURFACE_ROTATION_FLOAT)) {
const float rotation = (SDL_GetNumberProperty(surface->props, SDL_PROP_SURFACE_ROTATION_FLOAT, 0) - angle);
SDL_SetFloatProperty(SDL_GetSurfaceProperties(rotated), SDL_PROP_SURFACE_ROTATION_FLOAT, rotation);
}
}
return rotated;
}