Adjust stage size after changing the scene

This commit is contained in:
Kai S. K. Engelbart 2020-06-10 10:05:25 +02:00
parent b068796f46
commit 46f8b1e767

View File

@ -108,6 +108,7 @@ public final class SceneContext {
sceneStack.push(scene); sceneStack.push(scene);
stage.setScene(scene); stage.setScene(scene);
applyCSS(); applyCSS();
stage.sizeToScene();
stage.show(); stage.show();
} catch (IOException e) { } catch (IOException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
@ -124,6 +125,7 @@ public final class SceneContext {
if (!sceneStack.isEmpty()) { if (!sceneStack.isEmpty()) {
stage.setScene(sceneStack.peek()); stage.setScene(sceneStack.peek());
applyCSS(); applyCSS();
stage.sizeToScene();
} }
stage.show(); stage.show();
} }