summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ui/paint.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/ui/paint.c b/src/ui/paint.c
index 9c6711f1..1ac12a66 100644
--- a/src/ui/paint.c
+++ b/src/ui/paint.c
@@ -62,6 +62,11 @@ void endTarget_Paint(iPaint *d) {
62} 62}
63 63
64void setClip_Paint(iPaint *d, iRect rect) { 64void setClip_Paint(iPaint *d, iRect rect) {
65 if (rect.pos.y < 0) {
66 const int off = rect.pos.y;
67 rect.pos.y -= off;
68 rect.size.y = iMax(0, rect.size.y + off);
69 }
65 SDL_RenderSetClipRect(renderer_Paint_(d), (const SDL_Rect *) &rect); 70 SDL_RenderSetClipRect(renderer_Paint_(d), (const SDL_Rect *) &rect);
66} 71}
67 72