diff options
-rw-r--r-- | src/jrummikub/view/impl/SettingsPanel.java | 1 | ||||
-rw-r--r-- | src/jrummikub/view/impl/StonePainter.java | 15 |
2 files changed, 10 insertions, 6 deletions
diff --git a/src/jrummikub/view/impl/SettingsPanel.java b/src/jrummikub/view/impl/SettingsPanel.java index 3f577cc..4374640 100644 --- a/src/jrummikub/view/impl/SettingsPanel.java +++ b/src/jrummikub/view/impl/SettingsPanel.java @@ -330,6 +330,7 @@ class SettingsPanel extends JPanel implements ISettingsPanel { private void createColorButton(final StoneColor color) { JToggleButton button = new JToggleButton(ImageUtil.createColorIcon( StonePainter.getColor(color), 12, 1)); + button.setMargin(new Insets(0, 0, 0, 0)); button.addChangeListener(new ChangeListener() { @Override diff --git a/src/jrummikub/view/impl/StonePainter.java b/src/jrummikub/view/impl/StonePainter.java index 6b7e402..09b6dcc 100644 --- a/src/jrummikub/view/impl/StonePainter.java +++ b/src/jrummikub/view/impl/StonePainter.java @@ -159,8 +159,8 @@ class StonePainter { return img; } - private BufferedImage getStoneImage(StoneColor color, int value, boolean selected, - boolean hovered) { + private BufferedImage getStoneImage(StoneColor color, int value, + boolean selected, boolean hovered) { Map<StoneColor, Map<Integer, BufferedImage>> stoneMap; if (selected) { @@ -311,7 +311,8 @@ class StonePainter { g.setFont(new Font("SansSerif", Font.BOLD, r.height / 4)); FontMetrics fm = g.getFontMetrics(); - String value = (v > 0) ? Integer.toString(v) : Character.toString((char)(-v)); + String value = (v > 0) ? Integer.toString(v) : Character + .toString((char) (-v)); Rectangle2D stringRect = fm.getStringBounds(value, g); if (scale > 1) { @@ -359,10 +360,12 @@ class StonePainter { int x = Math.round(p.getX() * width), y = Math.round(p.getY() * height); if (stone.isJoker()) { - g.drawImage(getStoneImage(stone.getColor(), 0, selected, hovered), x, y, null); - } else { - g.drawImage(getStoneImage(stone.getColor(), stone.getValue(), selected, hovered), x, y, + g.drawImage(getStoneImage(stone.getColor(), 0, selected, hovered), x, y, null); + } else { + g.drawImage( + getStoneImage(stone.getColor(), stone.getValue(), selected, hovered), + x, y, null); } } } |