Skip to content

Commit 9d52503

Browse files
authored
Fix divide by zero issue when the window is minimized in some platforms.
1 parent 8af0c92 commit 9d52503

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

jme3-lwjgl3/src/main/java/com/jme3/system/lwjgl/LwjglWindow.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -374,8 +374,8 @@ private void updateSizes() {
374374
// framebuffer size (resolution) may differ from window size (e.g. HiDPI)
375375

376376
glfwGetWindowSize(window, width, height);
377-
int windowWidth = width[0];
378-
int windowHeight = height[0];
377+
int windowWidth = width[0] < 1 ? 1 : width[0];
378+
int windowHeight = height[0] < 1 ? 1 : height[0];
379379
if (settings.getWindowWidth() != windowWidth
380380
|| settings.getWindowHeight() != windowHeight) {
381381
settings.setWindowSize(windowWidth, windowHeight);

0 commit comments

Comments
 (0)