summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/fractal.jl6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/fractal.jl b/src/fractal.jl
index 41977c1..eb0b496 100644
--- a/src/fractal.jl
+++ b/src/fractal.jl
@@ -6,7 +6,11 @@ type Fractal{T <: FloatingPoint}
function Fractal(imgsize, make_c = z -> z, step = (z, c) -> z.^2 + c)
line = linspace(-2.0, 2.0, imgsize)
plane = [ complex(x, y) for x=line, y=line ]
- new(plane, make_c(plane), step)
+ c = make_c(plane)
+ if !isa(c, Array)
+ c = ones(plane) .* c
+ end
+ new(plane, c, step)
end
end