From 3c21b956700416556a483d083048dfae4bc339d8 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Tue, 28 Oct 2014 00:16:39 -0400 Subject: fix some more swapped array dimensions it is really hard to keep this straight --- src/fractal.jl | 10 +++++----- src/renderer.jl | 4 ++-- 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 -- cgit v1.2.3-54-g00ecf