diff options
Diffstat (limited to 'src/jrummikub/view/impl/TablePanel.java')
-rw-r--r-- | src/jrummikub/view/impl/TablePanel.java | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/jrummikub/view/impl/TablePanel.java b/src/jrummikub/view/impl/TablePanel.java index 7eb798d..7e2dfdb 100644 --- a/src/jrummikub/view/impl/TablePanel.java +++ b/src/jrummikub/view/impl/TablePanel.java @@ -152,9 +152,11 @@ class TablePanel extends AbstractStonePanel implements ITablePanel { @Override public void handle(Point p) { - Point p2 = SwingUtilities.convertPoint(stoneCollection, p, TablePanel.this); + Point p2 = SwingUtilities.convertPoint(stoneCollection, p, + TablePanel.this); clickAt(p2, 1, false, false); - }}); + } + }); add(stoneCollection); addComponentListener(new ComponentAdapter() { @@ -263,8 +265,8 @@ class TablePanel extends AbstractStonePanel implements ITablePanel { .getStoneHeight(); // Left connector - connectorArea.add(new Area(new Rectangle2D.Float((int) (x * width - width - * CONNECTOR_WIDTH), (int) (pos.getY() * height), + connectorArea.add(new Area(new Rectangle2D.Float(Math.round(x * width) + - (int) width * CONNECTOR_WIDTH, Math.round(pos.getY() * height), (int) (width * CONNECTOR_WIDTH), height))); for (Stone stone : stoneSet) { @@ -274,8 +276,9 @@ class TablePanel extends AbstractStonePanel implements ITablePanel { } // Right connector - connectorArea.add(new Area(new Rectangle2D.Float((int) (x * width), - (int) (pos.getY() * height), (int) (width * CONNECTOR_WIDTH), height))); + connectorArea.add(new Area(new Rectangle2D.Float(Math.round(x * width), + Math.round(pos.getY() * height), (int) (width * CONNECTOR_WIDTH), + height))); } @Override |