Skip to content

Commit

Permalink
Set preferredSize of canvas instead of frame
Browse files Browse the repository at this point in the history
  • Loading branch information
fniephaus committed Mar 10, 2021
1 parent 37b5496 commit 9e0c7d9
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ public void close() {
@Override
@TruffleBoundary
public void resizeTo(final int width, final int height) {
frame.setPreferredSize(new Dimension(width, height));
canvas.setPreferredSize(new Dimension(width, height));
frame.pack();
}

Expand Down Expand Up @@ -219,7 +219,8 @@ public void setFullscreen(final boolean enable) {
frame.setResizable(false);
} else {
frame.setExtendedState(Frame.NORMAL);
frame.setPreferredSize(rememberedWindowSize);
canvas.setPreferredSize(rememberedWindowSize);
frame.pack();
frame.setResizable(true);
}
frame.pack();
Expand Down Expand Up @@ -248,7 +249,7 @@ public void open(final PointersObject sqDisplay) {
}
frame.setTitle(title);
if (!frame.isVisible()) {
frame.setPreferredSize(new Dimension(image.flags.getSnapshotScreenWidth(), image.flags.getSnapshotScreenHeight()));
canvas.setPreferredSize(new Dimension(image.flags.getSnapshotScreenWidth(), image.flags.getSnapshotScreenHeight()));
frame.pack();
frame.setVisible(true);
frame.requestFocus();
Expand Down

0 comments on commit 9e0c7d9

Please sign in to comment.