diff --git a/src/main/java/carcassonne/view/secondary/PreviewGUI.java b/src/main/java/carcassonne/view/secondary/PreviewGUI.java index 1307af97..ab21170a 100644 --- a/src/main/java/carcassonne/view/secondary/PreviewGUI.java +++ b/src/main/java/carcassonne/view/secondary/PreviewGUI.java @@ -49,7 +49,7 @@ public PreviewGUI(MainController controller, MainGUI ui) { super(controller, ui); buildContent(); pack(); - selectionSize = buttonSkip.getWidth() + buttonRotateLeft.getWidth() + buttonRotateRight.getWidth() - VERTICAL_SPACE; + selectionSize = dialogPanel.getWidth() - VERTICAL_SPACE; defaultSize = (int) (selectionSize * SELECTION_FACTOR); } @@ -150,13 +150,13 @@ private void buildContent() { buttonRotateRight.addMouseListener((MouseClickListener) event -> rotateRight()); // set constraints: GridBagConstraints constraints = new GridBagConstraints(); - constraints.fill = GridBagConstraints.NONE; + constraints.fill = GridBagConstraints.VERTICAL; + constraints.weightx = 1; // keeps buttons evenly positioned. // add buttons: dialogPanel.add(buttonRotateLeft, constraints); dialogPanel.add(buttonSkip, constraints); dialogPanel.add(buttonRotateRight, constraints); // change constraints and add label: - constraints.fill = GridBagConstraints.VERTICAL; constraints.gridy = 1; constraints.gridwidth = 3; ImageIcon defaultImage = new Tile(TileType.Null).getScaledIcon(50);