mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-05-16 17:58:27 +00:00
render: Enable clipping for zero-sized rectangles
Battle for Wesnoth apparently relies on being able to disable rendering
of UI elements by setting the clip rectangle to be empty.
Resolves: https://github.com/libsdl-org/SDL/issues/6896
Fixes: 00f05dcf
"render: only enable clipping when the rectangle is valid"
Signed-off-by: Simon McVittie <smcv@collabora.com>
This commit is contained in:
parent
22d81fb3e9
commit
7207bdce5d
1 changed files with 1 additions and 1 deletions
|
@ -2534,7 +2534,7 @@ int SDL_SetRenderClipRect(SDL_Renderer *renderer, const SDL_Rect *rect)
|
|||
int retval;
|
||||
CHECK_RENDERER_MAGIC(renderer, -1)
|
||||
|
||||
if (rect && rect->w > 0 && rect->h > 0) {
|
||||
if (rect && rect->w >= 0 && rect->h >= 0) {
|
||||
renderer->view->clipping_enabled = SDL_TRUE;
|
||||
renderer->view->clip_rect.x = rect->x;
|
||||
renderer->view->clip_rect.y = rect->y;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue