The Java console keeps showing up error reports due to being asked

to resize the puzzle to zero size. Ignore all such requests, in the
assumption that a more sensible resize will be along soon enough
(which does seem to happen, though I haven't debugged the NestedVM
front end hard enough to figure out why the bogus resizes happen in
the first place).

[originally from svn r8094]
This commit is contained in:
Simon Tatham
2008-06-26 19:07:44 +00:00
parent 1df94d233a
commit 82b6a6fd39

View File

@ -476,12 +476,14 @@ public class PuzzleApplet extends JApplet implements Runtime.CallJavaCB {
}
public void createBackBuffer(int w, int h, Color bg) {
if (w > 0 && h > 0) {
backBuffer = new BufferedImage(w,h, BufferedImage.TYPE_3BYTE_BGR);
Graphics g = backBuffer.createGraphics();
g.setColor(bg);
g.fillRect(0, 0, w, h);
g.dispose();
}
}
protected void paintComponent(Graphics g) {
g.drawImage(backBuffer, 0, 0, this);