summaryrefslogtreecommitdiff
path: root/src/ui
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2020-11-27 09:26:20 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2020-11-27 09:26:20 +0200
commitf1e28849822fb9acc6a63e175443e9bd1fd11c04 (patch)
treea472a35662e7229e4c7d2a2c92ea975991048df1 /src/ui
parent10f11a8d13c808713f979557a5c96fcaadacf92e (diff)
Paint: Negative clipping rectangle position
Diffstat (limited to 'src/ui')
-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