summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2014-10-28 00:16:39 -0400
committerJesse Luehrs <doy@tozt.net>2014-10-28 00:16:39 -0400
commit3c21b956700416556a483d083048dfae4bc339d8 (patch)
tree8e1c0ea82a7b8c4552210873dfc9c35b30ad33ba
parente28f3e6a7eb292479f4d893e7f649faace90e357 (diff)
downloadjulia-fractals-3c21b956700416556a483d083048dfae4bc339d8.tar.gz
julia-fractals-3c21b956700416556a483d083048dfae4bc339d8.zip
fix some more swapped array dimensions
it is really hard to keep this straight
-rw-r--r--src/fractal.jl10
-rw-r--r--src/renderer.jl4
2 files changed, 7 insertions, 7 deletions
diff --git a/src/fractal.jl b/src/fractal.jl
index 58b76d6..67c8205 100644
--- a/src/fractal.jl
+++ b/src/fractal.jl
@@ -8,14 +8,14 @@ type Fractal{T <: FloatingPoint}
make_c::Function,
step::Function
)
- (size_y, size_x) = imgsize
+ (size_x, size_y) = imgsize
aspect_ratio = size_y / size_x
if size_x < size_y
- range_x = (-2.0 * aspect_ratio, 2.0 * aspect_ratio)
- range_y = (-2.0, 2.0)
- else
range_x = (-2.0, 2.0)
- range_y = (-2.0 / aspect_ratio, 2.0 / aspect_ratio)
+ range_y = (-2.0 * aspect_ratio, 2.0 * aspect_ratio)
+ else
+ range_x = (-2.0 / aspect_ratio, 2.0 / aspect_ratio)
+ range_y = (-2.0, 2.0)
end
line_x = linspace(range_x[1], range_x[2], size_x)
line_y = linspace(range_y[1], range_y[2], size_y)
diff --git a/src/renderer.jl b/src/renderer.jl
index e57b23d..ef72b72 100644
--- a/src/renderer.jl
+++ b/src/renderer.jl
@@ -11,14 +11,14 @@ type FractalCanvas
function FractalCanvas(c::Canvas, make_c::Function, step::Function)
winsize = tuple(get_size(c)...)
f = FractalExplorer.Fractal{Float64}(winsize, make_c, step)
- image = [ HSV(0, 0, 0) for y=1:winsize[1], x=1:winsize[2] ]
+ image = [ HSV(0, 0, 0) for y=1:winsize[2], x=1:winsize[1] ]
fc = new(c, f, image)
c.draw = function(x)
props = Dict()
img2 = ImageView.ImageSlice2d(fc.image, props)
imgc = ImageView.ImageCanvas(ImageView.cairo_format(fc.image), props)
imgc.c = fc.c
- ImageView.allocate_surface!(imgc, winsize[2], winsize[1])
+ ImageView.allocate_surface!(imgc, winsize[1], winsize[2])
ImageView.rerender(imgc, img2)
ImageView.resize(imgc, img2)
end