LwjglNativesLoader.load();\r
\r
canvas = new Canvas() {\r
- private final Dimension minSize = new Dimension();\r
+ private final Dimension minSize = new Dimension(0, 0);\r
\r
public final void addNotify () {\r
super.addNotify();\r
listener.resize(graphics.getWidth(), graphics.getHeight());\r
\r
final Runnable runnable = new Runnable() {\r
- int lastWidth = graphics.getWidth();\r
- int lastHeight = graphics.getHeight();\r
+ int lastWidth = Math.max(1, graphics.getWidth());\r
+ int lastHeight = Math.max(1, graphics.getHeight());\r
\r
public void run () {\r
if (!running) return;\r
graphics.updateTime();\r
input.update();\r
\r
- if (lastWidth != graphics.getWidth() || lastHeight != graphics.getHeight()) {\r
- lastWidth = graphics.getWidth();\r
- lastHeight = graphics.getHeight();\r
- listener.resize(lastWidth, lastHeight);\r
+ int width = Math.max(1, graphics.getWidth());\r
+ int height = Math.max(1, graphics.getHeight());\r
+ if (lastWidth != width || lastHeight != height) {\r
+ lastWidth = width;\r
+ lastHeight = height;\r
+ listener.resize(width, height);\r
}\r
\r
listener.render();\r