OSDN Git Service

LwjglGraphics, never allow canvas size of 0.
authorNathanSweet <nathan.sweet@gmail.com>
Tue, 19 Feb 2013 18:48:23 +0000 (19:48 +0100)
committerNathanSweet <nathan.sweet@gmail.com>
Tue, 19 Feb 2013 18:48:23 +0000 (19:48 +0100)
backends/gdx-backend-lwjgl/src/com/badlogic/gdx/backends/lwjgl/LwjglGraphics.java

index ee4f57a..a915f9d 100644 (file)
@@ -94,14 +94,14 @@ public class LwjglGraphics implements Graphics {
 \r
        public int getHeight () {\r
                if (canvas != null)\r
-                       return canvas.getHeight();\r
+                       return Math.max(1, canvas.getHeight());\r
                else\r
                        return Display.getHeight();\r
        }\r
 \r
        public int getWidth () {\r
                if (canvas != null)\r
-                       return canvas.getWidth();\r
+                       return Math.max(1, canvas.getWidth());\r
                else\r
                        return Display.getWidth();\r
        }\r