diff --git a/examples/core/core_scissor_test.c b/examples/core/core_scissor_test.c index 56eb84f80..278deec51 100644 --- a/examples/core/core_scissor_test.c +++ b/examples/core/core_scissor_test.c @@ -20,6 +20,9 @@ int main(void) const int screenWidth = 800; const int screenHeight = 450; + // If you have a high DPI screen you'll have to set the High DPI flag. + // SetConfigFlags(FLAG_WINDOW_HIGHDPI); + InitWindow(screenWidth, screenHeight, "raylib [core] example - scissor test"); Rectangle scissorArea = { 0, 0, 300, 300 }; diff --git a/src/rcore.c b/src/rcore.c index ec1601ca1..3b573a928 100644 --- a/src/rcore.c +++ b/src/rcore.c @@ -2188,7 +2188,8 @@ void BeginScissorMode(int x, int y, int width, int height) { Vector2 scale = GetWindowScaleDPI(); - rlScissor((int)(x*scale.x), (int)(CORE.Window.currentFbo.height - (y + height)*scale.y), (int)(width*scale.x), (int)(height*scale.y)); + rlScissor((int)(x*scale.x), (int)(CORE.Window.currentFbo.height - y*scale.y - height/scale.y), + (int)(width*scale.x), (int)(height*scale.y)); } else {