mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-16 00:08:14 +00:00
render: GetRenderViewportSize shouldn't scale viewport dimensions.
These are already scaled for the logical presentation (unless using the pixel dimensions instead; we still scale those here). Fixes #11704.
This commit is contained in:
@@ -3007,13 +3007,13 @@ static void GetRenderViewportSize(SDL_Renderer *renderer, SDL_FRect *rect)
|
|||||||
rect->y = 0.0f;
|
rect->y = 0.0f;
|
||||||
|
|
||||||
if (view->viewport.w >= 0) {
|
if (view->viewport.w >= 0) {
|
||||||
rect->w = (float)view->viewport.w / scale_x;
|
rect->w = (float)view->viewport.w;
|
||||||
} else {
|
} else {
|
||||||
rect->w = view->pixel_w / scale_x;
|
rect->w = view->pixel_w / scale_x;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (view->viewport.h >= 0) {
|
if (view->viewport.h >= 0) {
|
||||||
rect->h = (float)view->viewport.h / scale_y;
|
rect->h = (float)view->viewport.h;
|
||||||
} else {
|
} else {
|
||||||
rect->h = view->pixel_h / scale_y;
|
rect->h = view->pixel_h / scale_y;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user