Fix scissor on macos

This commit is contained in:
Arnaud Valensi 2021-11-24 10:00:35 +01:00
parent 3dca86ea55
commit 021985909b

View File

@ -2184,6 +2184,14 @@ void BeginScissorMode(int x, int y, int width, int height)
rlEnableScissorTest(); 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) if ((CORE.Window.flags & FLAG_WINDOW_HIGHDPI) > 0)
{ {
Vector2 scale = GetWindowScaleDPI(); 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); rlScissor(x, CORE.Window.currentFbo.height - (y + height), width, height);
} }
#endif
} }
// End scissor mode // End scissor mode