diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-11-27 09:26:20 +0200 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-11-27 09:26:20 +0200 |
commit | f1e28849822fb9acc6a63e175443e9bd1fd11c04 (patch) | |
tree | a472a35662e7229e4c7d2a2c92ea975991048df1 /src/ui/paint.c | |
parent | 10f11a8d13c808713f979557a5c96fcaadacf92e (diff) |
Paint: Negative clipping rectangle position
Diffstat (limited to 'src/ui/paint.c')
-rw-r--r-- | src/ui/paint.c | 5 |
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 | ||
64 | void setClip_Paint(iPaint *d, iRect rect) { | 64 | void 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 | ||