aboutsummaryrefslogtreecommitdiff
path: root/PuzzleApplet.java
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2008-06-26 19:07:44 +0000
committerSimon Tatham <anakin@pobox.com>2008-06-26 19:07:44 +0000
commit82b6a6fd39fc49ab511b3b4d748b415eb6af704a (patch)
tree9c018cc3aeae98bb539ed3d4f31d3d24c1dfad02 /PuzzleApplet.java
parent1df94d233a507a7124d5a636148d3f5a085de397 (diff)
downloadpuzzles-82b6a6fd39fc49ab511b3b4d748b415eb6af704a.zip
puzzles-82b6a6fd39fc49ab511b3b4d748b415eb6af704a.tar.gz
puzzles-82b6a6fd39fc49ab511b3b4d748b415eb6af704a.tar.bz2
puzzles-82b6a6fd39fc49ab511b3b4d748b415eb6af704a.tar.xz
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]
Diffstat (limited to '')
-rw-r--r--PuzzleApplet.java12
1 files changed, 7 insertions, 5 deletions
diff --git a/PuzzleApplet.java b/PuzzleApplet.java
index 4c9928d..ef7ca7e 100644
--- a/PuzzleApplet.java
+++ b/PuzzleApplet.java
@@ -476,11 +476,13 @@ public class PuzzleApplet extends JApplet implements Runtime.CallJavaCB {
}
public void createBackBuffer(int w, int h, Color bg) {
- backBuffer = new BufferedImage(w,h, BufferedImage.TYPE_3BYTE_BGR);
- Graphics g = backBuffer.createGraphics();
- g.setColor(bg);
- g.fillRect(0, 0, w, h);
- g.dispose();
+ 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) {