Skip to content
Snippets Groups Projects
Commit 6ca8952b authored by Edvard Berdal Eek's avatar Edvard Berdal Eek
Browse files

Fix bug with resetGame button functionality

parent 2c0e7da5
No related branches found
No related tags found
1 merge request!21Fix major bug when creating affine fractal with certain matrices.
Pipeline #288245 passed
...@@ -44,6 +44,7 @@ public class ChaosGameController implements Observer, Subject, GameController { ...@@ -44,6 +44,7 @@ public class ChaosGameController implements Observer, Subject, GameController {
private static final int WIDTH = 1200; private static final int WIDTH = 1200;
private static final int HEIGHT = 800; private static final int HEIGHT = 800;
private Canvas canvas; private Canvas canvas;
private double cumulativeScaleFactor = 1;
/** /**
* Constructor for the ChaosGameController. * Constructor for the ChaosGameController.
...@@ -276,6 +277,7 @@ public class ChaosGameController implements Observer, Subject, GameController { ...@@ -276,6 +277,7 @@ public class ChaosGameController implements Observer, Subject, GameController {
chaosGame.getTotalSteps(), chaosGame.getTotalSteps(),
chaosGame.getDescription().getMinCoords(), chaosGame.getDescription().getMinCoords(),
chaosGame.getDescription().getMaxCoords()); chaosGame.getDescription().getMaxCoords());
chaosGame.getCanvas().clearCanvas();
chaosPage.clearCanvas(); chaosPage.clearCanvas();
} }
......
...@@ -164,6 +164,8 @@ public class ChaosGame implements Subject { ...@@ -164,6 +164,8 @@ public class ChaosGame implements Subject {
/** /**
* Method for running the chaos game. Randomly selects a transformation * Method for running the chaos game. Randomly selects a transformation
* from the description and applies it to the current point. * from the description and applies it to the current point.
*
* @param steps Number of steps to run
*/ */
private void runStepsUniform(int steps) { private void runStepsUniform(int steps) {
for (int i = 0; i < steps; i++) { for (int i = 0; i < steps; i++) {
......
No preview for this file type
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