Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Only calculate $delta-re and use it for both values, to make sure our…

… pixels are square.
  • Loading branch information...
commit 975571e4ac3d4436d3ba39f16f2bede83432f2ec 1 parent 3c71b6e
@colomon authored
Showing with 3 additions and 4 deletions.
  1. +3 −4 bin/gtk-mandelbrot.pl
View
7 bin/gtk-mandelbrot.pl
@@ -266,13 +266,12 @@ ($obj, $args)
my $window = $obj.GdkWindow;
$window.GetGeometry($windowX, $windowY, $windowWidth, $windowHeight, $windowDepth);
- my $delta-re = ($lower-left.re - $upper-right.re) / $windowWidth;
- my $delta-im = ($upper-right.im - $lower-left.im) / $windowHeight;
+ my $delta = ($lower-left.re - $upper-right.re) / $windowWidth;
my %colors;
for 0 .. $windowHeight -> $y {
- my $c = $upper-right - $y * $delta-im * i;
+ my $c = $upper-right - $y * $delta * i;
for 0 .. $windowWidth -> $x {
my $value = mandel($c);
@@ -286,7 +285,7 @@ ($obj, $args)
$window.DrawPoint(%colors{$value}, $x, $y);
- $c += $delta-re;
+ $c += $delta;
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.