From 9cf76f2d45ad9aa9dba505bffa7d59ce807a3b7b Mon Sep 17 00:00:00 2001 From: "@clasher113" Date: Mon, 15 Jan 2024 20:21:25 +0200 Subject: [PATCH] Zero window size fix (OS Windows) --- src/window/Window.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/window/Window.cpp b/src/window/Window.cpp index 2e8344b0..05d4dd68 100644 --- a/src/window/Window.cpp +++ b/src/window/Window.cpp @@ -60,15 +60,17 @@ bool Window::isFocused() } void window_size_callback(GLFWwindow*, int width, int height) { - if (Window::isFocused() && width && height) { - glViewport(0, 0, width, height); - Window::width = width; - Window::height = height; - } + if (width && height) { + if (Window::isFocused()) { + glViewport(0, 0, width, height); + Window::width = width; + Window::height = height; + } - if (!Window::isFullscreen() && !Window::isMaximized()) { - Window::getSettings()->width = width; - Window::getSettings()->height = height; + if (!Window::isFullscreen() && !Window::isMaximized()) { + Window::getSettings()->width = width; + Window::getSettings()->height = height; + } } Window::resetScissor(); }