summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2011-05-31 04:52:26 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2011-05-31 04:52:26 +0200
commit58d58c0c07bd140b3bb30428e9726cf8986b1141 (patch)
tree0fa9b287ebb664f8a00f9d21c27f1c791a9833de
parent66b4094d176a4ce40c28cad59f8f447badacdc72 (diff)
downloadJRummikub-58d58c0c07bd140b3bb30428e9726cf8986b1141.tar
JRummikub-58d58c0c07bd140b3bb30428e9726cf8986b1141.zip
Don't throw exceptions on infinitesimal window sizes
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@345 72836036-5685-4462-b002-a69064685172
-rw-r--r--src/jrummikub/view/impl/StonePainter.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/jrummikub/view/impl/StonePainter.java b/src/jrummikub/view/impl/StonePainter.java
index c644ea1..6b7e402 100644
--- a/src/jrummikub/view/impl/StonePainter.java
+++ b/src/jrummikub/view/impl/StonePainter.java
@@ -128,14 +128,14 @@ class StonePainter {
* @return the width of a stone in the current scale in pixels
*/
public int getStoneWidth() {
- return even(DEFAULT_WIDTH * scale);
+ return Math.max(even(DEFAULT_WIDTH * scale), 1);
}
/**
* @return the height of a stone in the current scale in pixels
*/
public int getStoneHeight() {
- return (int) (DEFAULT_WIDTH * scale / ASPECT_RATIO);
+ return Math.max((int) (DEFAULT_WIDTH * scale / ASPECT_RATIO), 1);
}
private BufferedImage prepaintStone(Color fg, Color bg, int value) {