From 67ebc6be839c1cfd7caf5253e697064bb6864865 Mon Sep 17 00:00:00 2001 From: kske Date: Fri, 20 Nov 2020 14:01:00 +0100 Subject: [PATCH] Initialize scene with stage size in SceneContext This apparently fixes the rendering issues when switching scenes, while keeping the stage size constant (unless the user resizes the stage). --- .../main/java/envoy/client/ui/SceneContext.java | 3 +-- client/src/main/resources/fxml/ChatScene.fxml | 10 ++++------ client/src/main/resources/fxml/SettingsScene.fxml | 15 +++++++++++---- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/client/src/main/java/envoy/client/ui/SceneContext.java b/client/src/main/java/envoy/client/ui/SceneContext.java index 0940c28..5af7fd0 100644 --- a/client/src/main/java/envoy/client/ui/SceneContext.java +++ b/client/src/main/java/envoy/client/ui/SceneContext.java @@ -66,12 +66,11 @@ public final class SceneContext implements EventListener { if (scene == null) { // One-time scene initialization - scene = new Scene(root); + scene = new Scene(root, stage.getWidth(), stage.getHeight()); applyCSS(); stage.setScene(scene); } else { scene.setRoot(root); - stage.sizeToScene(); } stage.setResizable(info.resizable); diff --git a/client/src/main/resources/fxml/ChatScene.fxml b/client/src/main/resources/fxml/ChatScene.fxml index f293d3e..88d5d0a 100644 --- a/client/src/main/resources/fxml/ChatScene.fxml +++ b/client/src/main/resources/fxml/ChatScene.fxml @@ -24,8 +24,8 @@ @@ -57,8 +57,7 @@ - + @@ -156,8 +155,7 @@ - + diff --git a/client/src/main/resources/fxml/SettingsScene.fxml b/client/src/main/resources/fxml/SettingsScene.fxml index 50a90ab..edca898 100644 --- a/client/src/main/resources/fxml/SettingsScene.fxml +++ b/client/src/main/resources/fxml/SettingsScene.fxml @@ -7,11 +7,16 @@ - + - + @@ -22,7 +27,8 @@ - + @@ -32,7 +38,8 @@ -