From 6928ed87c0a9fa7f746c4331d0a1079d15f09051 Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Fri, 5 Jun 2015 14:22:12 +0200 Subject: Everything works except for multiple swingworkers --- .../src/com/camilstaps/mandelbrot/MandelbrotFractal.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Week15 Mandelbrot/src/com/camilstaps/mandelbrot/MandelbrotFractal.java') diff --git a/Week15 Mandelbrot/src/com/camilstaps/mandelbrot/MandelbrotFractal.java b/Week15 Mandelbrot/src/com/camilstaps/mandelbrot/MandelbrotFractal.java index e0c0520..1c608fd 100644 --- a/Week15 Mandelbrot/src/com/camilstaps/mandelbrot/MandelbrotFractal.java +++ b/Week15 Mandelbrot/src/com/camilstaps/mandelbrot/MandelbrotFractal.java @@ -72,7 +72,7 @@ public class MandelbrotFractal { protected static void calculateMandelNumber(Point p, int repetitions, Result start) { int n = start.repetitions; - while (start.x * start.x + start.y * start.y <= 4 && n <= repetitions) { + while (start.x * start.x + start.y * start.y <= 4 && n < repetitions) { double new_x = start.x * start.x - start.y * start.y + p.x; start.y = 2 * start.x * start.y + p.y; start.x = new_x; @@ -114,7 +114,7 @@ public class MandelbrotFractal { } protected static class Result { - int mandelNumber = -1, repetitions = -1; + int mandelNumber = -1, repetitions = 0; double x, y; } -- cgit v1.2.3