From 58d58c0c07bd140b3bb30428e9726cf8986b1141 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 31 May 2011 04:52:26 +0200 Subject: 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 --- src/jrummikub/view/impl/StonePainter.java | 4 ++-- 1 file 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) { -- cgit v1.2.3