Skip to content
Snippets Groups Projects
Commit f7e8dd5c authored by Magnus Eik's avatar Magnus Eik
Browse files

Merge with gitlab and add canvasHeight and canvasWidth.

parent 5936e711
No related branches found
No related tags found
No related merge requests found
......@@ -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());
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment