File tree 3 files changed +9
-5
lines changed
src/main/java/tbooop/view
3 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -85,7 +85,11 @@ public void handleInput(final Optional<Keybinds> keybind) {
85
85
case SHOOT_LEFT -> sendCommand (new ShootCommand (CardinalDirection .LEFT ));
86
86
case SHOOT_RIGHT -> sendCommand (new ShootCommand (CardinalDirection .RIGHT ));
87
87
case FULLSCREEN -> view .getStage ().setFullScreen (!view .getStage ().isFullScreen ());
88
- case EXIT_FULLSCREEN -> resizeWindow (false );
88
+ case EXIT_FULLSCREEN -> {
89
+ System .out .println ("Exiting fullscreen" );
90
+ view .getStage ().setWidth (view .getStage ().getWidth () / 2 );
91
+ resizeWindow (false );
92
+ }
89
93
case ZOOM_IN -> resizeWindow (true );
90
94
case ZOOM_OUT -> resizeWindow (false );
91
95
default -> {
@@ -103,8 +107,7 @@ private void resizeWindow(final boolean scaleUp) {
103
107
if (newWidth < RoomBounds .WIDTH ) {
104
108
return ;
105
109
}
106
- if (newWidth / view .getStageAspectRatio ()
107
- > Screen .getPrimary ().getVisualBounds ().getHeight ()) {
110
+ if (newWidth / view .getStageAspectRatio () > Screen .getPrimary ().getVisualBounds ().getHeight ()) {
108
111
view .getStage ().setFullScreen (true );
109
112
return ;
110
113
}
Original file line number Diff line number Diff line change @@ -182,6 +182,6 @@ private synchronized Point2d worldToScreenPos(final Point2d worldPos) {
182
182
@ Override
183
183
public void showDeathScreen () {
184
184
super .getStage ().setScene (new DeathScreen ().getDeathScene (getStage ().getWidth (), getStage ().getHeight ()));
185
- }
185
+ }
186
186
187
187
}
Original file line number Diff line number Diff line change @@ -97,7 +97,8 @@ public KeyCode getKeyCode() {
97
97
public static boolean isGui (final Keybinds keybind ) {
98
98
return keybind == Keybinds .FULLSCREEN
99
99
|| keybind == Keybinds .ZOOM_IN
100
- || keybind == Keybinds .ZOOM_OUT ;
100
+ || keybind == Keybinds .ZOOM_OUT
101
+ || keybind == Keybinds .EXIT_FULLSCREEN ;
101
102
}
102
103
103
104
/**
You can’t perform that action at this time.
0 commit comments