Prechádzať zdrojové kódy

Fix divide by zero issue when the window is minimized in some platforms.

Riccardo Balbo 3 rokov pred
rodič
commit
9d52503d0d

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

@@ -374,8 +374,8 @@ public abstract class LwjglWindow extends LwjglContext implements Runnable {
         // framebuffer size (resolution) may differ from window size (e.g. HiDPI)
 
         glfwGetWindowSize(window, width, height);
-        int windowWidth = width[0];
-        int windowHeight = height[0];
+        int windowWidth = width[0] < 1 ? 1 : width[0];
+        int windowHeight = height[0] < 1 ? 1 : height[0];
         if (settings.getWindowWidth() != windowWidth
                 || settings.getWindowHeight() != windowHeight) {
             settings.setWindowSize(windowWidth, windowHeight);