summaryrefslogtreecommitdiffhomepage
path: root/src/core.c
diff options
context:
space:
mode:
authorIlya3point999K <[email protected]>2020-11-15 17:13:21 +0500
committerGitHub <[email protected]>2020-11-15 13:13:21 +0100
commitbd287efa4c953599d8b2dccebe3c310d97404312 (patch)
treed8c3eb718967be64e1371232a994ed60b7d599ee /src/core.c
parent9b2b660f912d1379ecb0f220b8c8c28b826da5ac (diff)
downloadraylib-bd287efa4c953599d8b2dccebe3c310d97404312.tar.gz
raylib-bd287efa4c953599d8b2dccebe3c310d97404312.zip
Fixed zero-window upscaling (#1428)
There is no zero-check, so window upscales to nothing. SetupFramebuffer() is kinda wrong, it uses not its params, but global variables. I won't touch it, maybe it has purpose
Diffstat (limited to 'src/core.c')
-rw-r--r--src/core.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/core.c b/src/core.c
index 79514a18..939fb70c 100644
--- a/src/core.c
+++ b/src/core.c
@@ -3753,7 +3753,12 @@ static void SetupFramebuffer(int width, int height)
{
// Required screen size is smaller than display size
TRACELOG(LOG_INFO, "DISPLAY: Upscaling required: Screen size (%ix%i) smaller than display size (%ix%i)", CORE.Window.screen.width, CORE.Window.screen.height, CORE.Window.display.width, CORE.Window.display.height);
-
+
+ if (CORE.Window.screen.width == 0 || CORE.Window.screen.height == 0) {
+ CORE.Window.screen.width = CORE.Window.display.width;
+ CORE.Window.screen.height = CORE.Window.display.height;
+ }
+
// Upscaling to fit display with border-bars
float displayRatio = (float)CORE.Window.display.width/(float)CORE.Window.display.height;
float screenRatio = (float)CORE.Window.screen.width/(float)CORE.Window.screen.height;