diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2011-05-31 04:52:26 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2011-05-31 04:52:26 +0200 |
commit | 58d58c0c07bd140b3bb30428e9726cf8986b1141 (patch) | |
tree | 0fa9b287ebb664f8a00f9d21c27f1c791a9833de /src/jrummikub/view/impl | |
parent | 66b4094d176a4ce40c28cad59f8f447badacdc72 (diff) | |
download | JRummikub-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
Diffstat (limited to 'src/jrummikub/view/impl')
-rw-r--r-- | src/jrummikub/view/impl/StonePainter.java | 4 |
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) { |