diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-03-29 19:02:10 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-03-29 19:02:10 +0300 |
commit | b74f7362fd0ad43b50fdda6c7b50a24dd158f53b (patch) | |
tree | 2c5c15019f6da4c21155aba7e391ac88a9cc48e7 /src/ui | |
parent | f50c73573c4e8ddec450a05192b8d950f026941d (diff) |
Paint: Fixed clipping of negative X regions
Diffstat (limited to 'src/ui')
-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 36e3f703..857bf20c 100644 --- a/src/ui/paint.c +++ b/src/ui/paint.c | |||
@@ -67,6 +67,11 @@ void setClip_Paint(iPaint *d, iRect rect) { | |||
67 | rect.pos.y -= off; | 67 | rect.pos.y -= off; |
68 | rect.size.y = iMax(0, rect.size.y + off); | 68 | rect.size.y = iMax(0, rect.size.y + off); |
69 | } | 69 | } |
70 | if (rect.pos.x < 0) { | ||
71 | const int off = rect.pos.x; | ||
72 | rect.pos.x -= off; | ||
73 | rect.size.x = iMax(0, rect.size.x + off); | ||
74 | } | ||
70 | SDL_RenderSetClipRect(renderer_Paint_(d), (const SDL_Rect *) &rect); | 75 | SDL_RenderSetClipRect(renderer_Paint_(d), (const SDL_Rect *) &rect); |
71 | } | 76 | } |
72 | 77 | ||