mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-04-04 14:49:40 +00:00
render: Fixed a FIXME for SDL_SetRenderViewport with a negative size.
This commit is contained in:
@@ -2932,7 +2932,9 @@ bool SDL_SetRenderViewport(SDL_Renderer *renderer, const SDL_Rect *rect)
|
||||
CHECK_RENDERER_MAGIC(renderer, false);
|
||||
|
||||
if (rect) {
|
||||
// !!! FIXME: fail if rect->w or rect->h are negative (we use this to mean "the whole viewport").
|
||||
if ((rect->w < 0) || (rect->h < 0)) {
|
||||
return SDL_SetError("rect has a negative size");
|
||||
}
|
||||
SDL_copyp(&renderer->view->viewport, rect);
|
||||
} else {
|
||||
renderer->view->viewport.x = 0;
|
||||
|
||||
Reference in New Issue
Block a user