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

Fix minor bug with setMaxMinCoords method

parent 5e03b1bc
No related branches found
No related tags found
1 merge request!21Fix major bug when creating affine fractal with certain matrices.
Pipeline #288216 passed
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>
\ No newline at end of file
......@@ -148,7 +148,8 @@ public class ChaosGameController implements Observer, Subject, GameController {
Double.parseDouble(coords.get(3)));
updateChaosGame(new ChaosGameDescription(min, max,
chaosGame.getDescription().getTransforms()));
chaosGame.getDescription().getTransforms(),
chaosGame.getDescription().getProbabilities()));
} catch (NumberFormatException e) {
AlertUtility.showErrorDialog("Invalid input",
"Please enter a valid number.");
......
......@@ -53,7 +53,7 @@ public class ChaosGameDescription {
throws IllegalArgumentException {
validateCoordinates(minCoords, maxCoords);
validateTransforms(transforms);
if (probabilities.size() != transforms.size()) {
if (probabilities != null && probabilities.size() != transforms.size()) {
throw new IllegalArgumentException("Probabilities must match the number of transformations");
}
this.minCoords = minCoords;
......
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