From 20f118801d8b18b0dd77ae35c8049ca5d6d9ad44 Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Sun, 15 Aug 2021 08:45:12 +0300 Subject: SDL 2.0.16 line drawing regression (OpenGL renderer) This is not specific to macOS, but seems to affect OpenGL rendering on all platforms. --- src/ui/paint.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/ui/paint.c') diff --git a/src/ui/paint.c b/src/ui/paint.c index 869238d5..79adb7d1 100644 --- a/src/ui/paint.c +++ b/src/ui/paint.c @@ -89,17 +89,19 @@ void drawRect_Paint(const iPaint *d, iRect rect, int color) { /* Keep the right/bottom edge visible in the window. */ if (br.x == d->dst->size.x) br.x--; if (br.y == d->dst->size.y) br.y--; - const SDL_Point edges[] = { + SDL_Point edges[] = { { left_Rect(rect), top_Rect(rect) }, { br.x, top_Rect(rect) }, { br.x, br.y }, -#if SDL_VERSION_ATLEAST(2, 0, 16) && defined (iPlatformApple) - { left_Rect(rect), br.y - 1 }, /* regression in SDL 2.0.16? */ -#else { left_Rect(rect), br.y }, -#endif { left_Rect(rect), top_Rect(rect) } }; +#if SDL_VERSION_ATLEAST(2, 0, 16) + if (isOpenGLRenderer_Window()) { + /* A very curious regression in SDL 2.0.16. */ + edges[3].y--; + } +#endif setColor_Paint_(d, color); SDL_RenderDrawLines(renderer_Paint_(d), edges, iElemCount(edges)); } -- cgit v1.2.3