From af33e3848ece9b7faa6816efec98d22711f65e2e Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 19 Dec 2018 17:06:23 +0100 Subject: [PATCH] Improved BeginScissorMode() Now rectangle coordinates refer to upper-left corner instead of bottom-left --- src/rlgl.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/rlgl.h b/src/rlgl.h index dfd2b3708..6b17dcf58 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -3283,12 +3283,13 @@ void EndBlendMode(void) } // Begin scissor mode (define screen area for following drawing) +// NOTE: Scissor rec refers to bottom-left corner, we change it to upper-left void BeginScissorMode(int x, int y, int width, int height) { rlglDraw(); // Force drawing elements glEnable(GL_SCISSOR_TEST); - glScissor(x, y, width, height); + glScissor(x, GetScreenHeight() - (y + height), width, height); rlClearScreenBuffers(); // Clear current scissor area }