From 1dc3052df1e1beef0fef93fd5cf0cea56669c234 Mon Sep 17 00:00:00 2001 From: rubenpirreram Date: Mon, 25 May 2026 18:09:19 +0200 Subject: [PATCH] Changed: Temp Fix Board Dim --- .../it/polimi/ingsw/gc14/View/GUI/GUI.java | 3 - .../gc14/View/GUI/MainFXMLController.java | 9 +- src/main/resources/GUIScene/main.fxml | 134 +++++++++--------- 3 files changed, 72 insertions(+), 74 deletions(-) diff --git a/src/main/java/it/polimi/ingsw/gc14/View/GUI/GUI.java b/src/main/java/it/polimi/ingsw/gc14/View/GUI/GUI.java index e757382..482df6b 100644 --- a/src/main/java/it/polimi/ingsw/gc14/View/GUI/GUI.java +++ b/src/main/java/it/polimi/ingsw/gc14/View/GUI/GUI.java @@ -109,9 +109,6 @@ public class GUI extends Application implements IView { double h = primaryStage.getHeight(); primaryStage.setWidth(w); primaryStage.setHeight(h); - primaryStage.setMinHeight(h); - primaryStage.setMinWidth(w); - primaryStage.setResizable(false); primaryStage.setScene(mainScene); controllerMain.render(); } diff --git a/src/main/java/it/polimi/ingsw/gc14/View/GUI/MainFXMLController.java b/src/main/java/it/polimi/ingsw/gc14/View/GUI/MainFXMLController.java index 6649d81..6aec818 100644 --- a/src/main/java/it/polimi/ingsw/gc14/View/GUI/MainFXMLController.java +++ b/src/main/java/it/polimi/ingsw/gc14/View/GUI/MainFXMLController.java @@ -41,6 +41,7 @@ import java.util.*; public class MainFXMLController { + @FXML private GridPane leftGrid; @FXML private ScrollPane playerSide; @FXML private HBox mainHBox; @FXML private ImageView backgroundImage; @@ -157,7 +158,7 @@ public class MainFXMLController { // ==== ELEMENTS ==== private StackPane createOrder(String num) { ImageView img = new ImageView(loadImage("/GUIImages/Orders/order-" + num + ".png")); - img.fitHeightProperty().bind(board.heightProperty().multiply(0.94)); + img.fitHeightProperty().bind(board.sceneProperty().get().heightProperty().subtract(40).divide(4).multiply(0.94)); img.setPreserveRatio(true); addClip(img); return new StackPane(img); @@ -166,7 +167,7 @@ public class MainFXMLController { private StackPane createSlot(Slot slot, boolean withZoom, boolean withShadow) { ImageView img = new ImageView(loadImage("/GUIImages/Fronts/card-" + slot.getSlotId() + ".png")); img.setPreserveRatio(true); - img.fitHeightProperty().bind(board.heightProperty().multiply(0.94)); // TODO perchè è tutto moltiplicato per una costante ma in board facciamo -15? + img.fitHeightProperty().bind(board.sceneProperty().get().heightProperty().subtract(40).divide(4).multiply(0.94)); // TODO perchè è tutto moltiplicato per una costante ma in board facciamo -15? addClip(img); StackPane wrapper = new StackPane(img); @@ -188,7 +189,7 @@ public class MainFXMLController { private StackPane createCard(PlayableCard card, boolean withZoom, boolean withShadow, Region parent) { ImageView img = new ImageView(loadImage("/GUIImages/Fronts/card-" + card.getIdIMG() + ".png")); img.setPreserveRatio(true); - img.fitHeightProperty().bind(parent.heightProperty().multiply(0.90)); + img.fitHeightProperty().bind(parent.getScene().heightProperty().subtract(40).divide(4).multiply(0.90)); addClip(img); StackPane wrapper = new StackPane(img); if (withShadow) addShadow(wrapper); @@ -458,7 +459,7 @@ public class MainFXMLController { default -> "/GUIImages/Backs/back-001.png"; }; ImageView back = new ImageView(loadImage(path)); - back.fitHeightProperty().bind(board.heightProperty().multiply(0.94)); + back.fitHeightProperty().bind(board.sceneProperty().get().heightProperty().divide(4).multiply(0.94)); back.setPreserveRatio(true); addClip(back); addShadow(back); diff --git a/src/main/resources/GUIScene/main.fxml b/src/main/resources/GUIScene/main.fxml index 324e2ef..bff8d0a 100644 --- a/src/main/resources/GUIScene/main.fxml +++ b/src/main/resources/GUIScene/main.fxml @@ -13,78 +13,78 @@ fx:controller="it.polimi.ingsw.gc14.View.GUI.MainFXMLController" stylesheets="@styles.css"> - - - - - - - - - - - - + + + + + + + + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - - - - - - - - - - - - - - - - - - - -