From 021985909b512f8ebf4917081cdc3921b18de409 Mon Sep 17 00:00:00 2001 From: Arnaud Valensi Date: Wed, 24 Nov 2021 10:00:35 +0100 Subject: [PATCH] Fix scissor on macos --- src/rcore.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/rcore.c b/src/rcore.c index ec1601ca1..a1f227a80 100644 --- a/src/rcore.c +++ b/src/rcore.c @@ -2184,6 +2184,14 @@ void BeginScissorMode(int x, int y, int width, int height) rlEnableScissorTest(); +#if defined(__APPLE__) + Vector2 scale = GetWindowScaleDPI(); + rlScissor( + (int)(x*scale.x), + (int)(GetScreenHeight() * scale.y - (((y + height) * scale.y))), + (int)(width*scale.x), + (int)(height*scale.y)); +#elif if ((CORE.Window.flags & FLAG_WINDOW_HIGHDPI) > 0) { Vector2 scale = GetWindowScaleDPI(); @@ -2194,6 +2202,7 @@ void BeginScissorMode(int x, int y, int width, int height) { rlScissor(x, CORE.Window.currentFbo.height - (y + height), width, height); } +#endif } // End scissor mode