From 94be15100d8b6cdbfe858dd3c9cce594fb1df05f Mon Sep 17 00:00:00 2001 From: Anthony Debucquoy Date: Thu, 4 May 2023 13:12:22 +0200 Subject: [PATCH] Keep the Shape Size Signed-off-by: Anthony Debucquoy --- app/src/main/java/school_project/Utils/MatrixShape.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/school_project/Utils/MatrixShape.java b/app/src/main/java/school_project/Utils/MatrixShape.java index 3d79f28..c2f9c94 100644 --- a/app/src/main/java/school_project/Utils/MatrixShape.java +++ b/app/src/main/java/school_project/Utils/MatrixShape.java @@ -1,22 +1,20 @@ package school_project.Utils; +import javafx.geometry.Rectangle2D; import javafx.scene.Node; import javafx.scene.image.Image; import javafx.scene.image.ImageView; import javafx.scene.layout.GridPane; -import javafx.scene.paint.Color; import javafx.scene.paint.Paint; import javafx.scene.shape.Rectangle; -import school_project.Controller; -import school_project.GameUI; -import school_project.Piece; -import school_project.Shape; +import school_project.*; import java.io.FileInputStream; import java.io.FileNotFoundException; public class MatrixShape extends GridPane { public Shape shape; + public Vec2 boundary_size = new Vec2(); private Paint color; public MatrixShape(Shape shape) { super(); @@ -52,6 +50,7 @@ public class MatrixShape extends GridPane { } } } + boundary_size = new Vec2((GameUI.SEGMENT_SIZE + GameUI.SPACE_SIZE) * shape.getWidth(), (GameUI.SEGMENT_SIZE + GameUI.SPACE_SIZE) * shape.getHeight()); } public void setColor(Paint p) { color = p;