summaryrefslogtreecommitdiff
path: root/src/ui/paint.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/paint.c')
-rw-r--r--src/ui/paint.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ui/paint.c b/src/ui/paint.c
index 5e66f521..67b509fb 100644
--- a/src/ui/paint.c
+++ b/src/ui/paint.c
@@ -71,9 +71,6 @@ void endTarget_Paint(iPaint *d) {
71 71
72void setClip_Paint(iPaint *d, iRect rect) { 72void setClip_Paint(iPaint *d, iRect rect) {
73 addv_I2(&rect.pos, origin_Paint); 73 addv_I2(&rect.pos, origin_Paint);
74 if (isEmpty_Rect(rect)) {
75 rect = init_Rect(0, 0, 1, 1);
76 }
77 iRect targetRect = zero_Rect(); 74 iRect targetRect = zero_Rect();
78 SDL_Texture *target = SDL_GetRenderTarget(renderer_Paint_(d)); 75 SDL_Texture *target = SDL_GetRenderTarget(renderer_Paint_(d));
79 if (target) { 76 if (target) {
@@ -83,6 +80,9 @@ void setClip_Paint(iPaint *d, iRect rect) {
83 else { 80 else {
84 rect = intersect_Rect(rect, rect_Root(get_Root())); 81 rect = intersect_Rect(rect, rect_Root(get_Root()));
85 } 82 }
83 if (isEmpty_Rect(rect)) {
84 rect = init_Rect(0, 0, 1, 1);
85 }
86 SDL_RenderSetClipRect(renderer_Paint_(d), (const SDL_Rect *) &rect); 86 SDL_RenderSetClipRect(renderer_Paint_(d), (const SDL_Rect *) &rect);
87} 87}
88 88