Keep the Shape Size

Signed-off-by: Anthony Debucquoy <debucquoy.anthony@gmail.com>
This commit is contained in:
Debucquoy Anthony 2023-05-04 13:12:22 +02:00
parent 382af6b541
commit 7b6291bda9
Signed by: tonitch
GPG Key ID: A78D6421F083D42E

View File

@ -1,22 +1,20 @@
package school_project.Utils; package school_project.Utils;
import javafx.geometry.Rectangle2D;
import javafx.scene.Node; import javafx.scene.Node;
import javafx.scene.image.Image; import javafx.scene.image.Image;
import javafx.scene.image.ImageView; import javafx.scene.image.ImageView;
import javafx.scene.layout.GridPane; import javafx.scene.layout.GridPane;
import javafx.scene.paint.Color;
import javafx.scene.paint.Paint; import javafx.scene.paint.Paint;
import javafx.scene.shape.Rectangle; import javafx.scene.shape.Rectangle;
import school_project.Controller; import school_project.*;
import school_project.GameUI;
import school_project.Piece;
import school_project.Shape;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
public class MatrixShape extends GridPane { public class MatrixShape extends GridPane {
public Shape shape; public Shape shape;
public Vec2 boundary_size = new Vec2();
private Paint color; private Paint color;
public MatrixShape(Shape shape) { public MatrixShape(Shape shape) {
super(); 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) { public void setColor(Paint p) {
color = p; color = p;