diff --git a/src/main/java/edu/ntnu/stud/chaosgame/view/ChaosGameGUIView.java b/src/main/java/edu/ntnu/stud/chaosgame/view/ChaosGameGUIView.java index c9d612ba20d53a9267e2b4907ffdfe63dd5d5308..b48ddb4037d671f80d1668f6e30e3d4c7508f3a0 100644 --- a/src/main/java/edu/ntnu/stud/chaosgame/view/ChaosGameGUIView.java +++ b/src/main/java/edu/ntnu/stud/chaosgame/view/ChaosGameGUIView.java @@ -49,6 +49,8 @@ public class ChaosGameGUIView { imageView = new ImageView(); width = 1000; height = 1000; + canvasHeight = 1000; + canvasWidth = 1000; WritableImage writableImage = new WritableImage(width, height); pixelWriter = writableImage.getPixelWriter(); @@ -62,7 +64,7 @@ public class ChaosGameGUIView { ChaosGameDescriptionFactory factory = new ChaosGameDescriptionFactory(); AtomicReference<ChaosGameDescription> description = new AtomicReference<>(factory.getDescriptions().get(0)); - ChaosCanvas canvas = new ChaosCanvas(1000, 1000, description.get().getMinCoords(), description.get().getMaxCoords()); + ChaosCanvas canvas = new ChaosCanvas(canvasWidth, canvasHeight, description.get().getMinCoords(), description.get().getMaxCoords()); game = new ChaosGame(description.get(), canvas); Button startButton = new Button("Start"); @@ -108,7 +110,7 @@ public class ChaosGameGUIView { canvas.clearCanvas(); description.set(factory.getDescriptions().get(0)); // Assuming the Sierpinski description is at index 0 - canvasRef.set(new ChaosCanvas(1000, 1000, description.get().getMinCoords(), description.get().getMaxCoords())); + canvasRef.set(new ChaosCanvas(canvasWidth, canvasHeight, description.get().getMinCoords(), description.get().getMaxCoords())); game = new ChaosGame(description.get(), canvasRef.get()); }); @@ -120,7 +122,7 @@ public class ChaosGameGUIView { setImageViewFromImage(newWritableImage); canvas.clearCanvas(); description.set(factory.getDescriptions().get(1)); // Assuming the Sierpinski description is at index 0 - canvasRef.set(new ChaosCanvas(1000, 1000, description.get().getMinCoords(), description.get().getMaxCoords())); + canvasRef.set(new ChaosCanvas(canvasWidth, canvasHeight, description.get().getMinCoords(), description.get().getMaxCoords())); game = new ChaosGame(description.get(), canvasRef.get()); }); @@ -132,7 +134,7 @@ public class ChaosGameGUIView { setImageViewFromImage(newWritableImage); canvas.clearCanvas(); description.set(factory.getDescriptions().get(2)); // Assuming the Sierpinski description is at index 0 - canvasRef.set(new ChaosCanvas(1000, 1000, description.get().getMinCoords(), description.get().getMaxCoords())); + canvasRef.set(new ChaosCanvas(canvasWidth, canvasHeight, description.get().getMinCoords(), description.get().getMaxCoords())); game = new ChaosGame(description.get(), canvasRef.get()); });