From b74f7362fd0ad43b50fdda6c7b50a24dd158f53b Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Mon, 29 Mar 2021 19:02:10 +0300 Subject: Paint: Fixed clipping of negative X regions --- src/ui/paint.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') 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) { rect.pos.y -= off; rect.size.y = iMax(0, rect.size.y + off); } + if (rect.pos.x < 0) { + const int off = rect.pos.x; + rect.pos.x -= off; + rect.size.x = iMax(0, rect.size.x + off); + } SDL_RenderSetClipRect(renderer_Paint_(d), (const SDL_Rect *) &rect); } -- cgit v1.2.3