Skip to content

Commit a8cf513

Browse files
committed
Fixed bugs reported by closure-compiler
1 parent eeffe5a commit a8cf513

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

mandelbrot.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ function hsv_to_rgb(h, s, v)
201201
var hp = h/60.0;
202202
var c = v * s;
203203
var x = c*(1 - Math.abs((hp % 2) - 1));
204+
var rgb = [0,0,0];
204205

205206
if ( 0<=hp && hp<1 ) rgb = [c, x, 0];
206207
if ( 1<=hp && hp<2 ) rgb = [x, c, 0];
@@ -456,7 +457,7 @@ function pickColorHSV1(steps, n, Tr, Ti)
456457
return interiorColor;
457458

458459
var v = smoothColor(steps, n, Tr, Ti);
459-
c = hsv_to_rgb(360.0*v/steps, 1.0, 1.0);
460+
var c = hsv_to_rgb(360.0*v/steps, 1.0, 1.0);
460461
c.push(255); // alpha
461462
return c;
462463
}
@@ -536,7 +537,7 @@ function main()
536537
};
537538

538539
if ( dragToZoom == true ) {
539-
box = null;
540+
var box = null;
540541

541542
$('canvasControls').onmousedown = function(e)
542543
{
@@ -561,7 +562,7 @@ function main()
561562
}
562563
}
563564

564-
var zoomOut = function() {
565+
var zoomOut = function(event) {
565566
var x = event.clientX;
566567
var y = event.clientY;
567568

@@ -590,7 +591,7 @@ function main()
590591
// Zoom out?
591592
if ( e.shiftKey ) {
592593
box = null;
593-
zoomOut();
594+
zoomOut(e);
594595
return;
595596
}
596597

0 commit comments

Comments
 (0)