Skip to content

Commit

Permalink
FIX: Fixed UI bug on Windows 10 where the preview UI was not scaling …
Browse files Browse the repository at this point in the history
…well when using the Windows UI scale settings. Windows 10 uses a very primitive UI scaling approach to deal with high-DPI, which works only somewhat well.
  • Loading branch information
tsaglam committed Aug 2, 2020
1 parent f47e23f commit b677e1f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/carcassonne/view/secondary/PreviewGUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit b677e1f

Please sign in to comment.