From 692e50ea4cb4026cfe2a3035c94d9cd174f60d24 Mon Sep 17 00:00:00 2001 From: Robert Konigsberg Date: Wed, 22 Dec 2010 14:25:26 -0800 Subject: [PATCH] interaction.html's zoom was off. Zooming in and zooming out weren't matching 1:1. The rest of it is whitespace cleansing. --- tests/interaction.html | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/tests/interaction.html b/tests/interaction.html index d768dd6..f4a1ff5 100644 --- a/tests/interaction.html +++ b/tests/interaction.html @@ -72,7 +72,7 @@ function dblClickV3(event, g, context) { if (event.ctrlKey) { - zoom(g, -(1/9)); + zoom(g, -(1/8)); } else { zoom(g, +.1); } @@ -90,23 +90,22 @@ } function zoom(g, percentage) { - // Adjusts [x, y] toward each other by percentage% - function adjustAxis(axis, percentage) { - var delta = axis[1] - axis[0]; - var increment = delta * percentage; - return [ axis[0] + increment, axis[1] - increment ]; - } - - var yAxes = g.yAxisRanges(); - var newYAxes = []; - for (var i = 0; i < yAxes.length; i++) { - newYAxes[i] = adjustAxis(yAxes[i], percentage); - } - - g.updateOptions({ - dateWindow: adjustAxis(g.xAxisRange(), percentage), - valueRange: newYAxes[0] - }); + // Adjusts [x, y] toward each other by percentage% + function adjustAxis(axis, percentage) { + var delta = axis[1] - axis[0]; + var increment = delta * percentage; + return [ axis[0] + increment, axis[1] - increment ]; + } + var yAxes = g.yAxisRanges(); + var newYAxes = []; + for (var i = 0; i < yAxes.length; i++) { + newYAxes[i] = adjustAxis(yAxes[i], percentage); + } + + g.updateOptions({ + dateWindow: adjustAxis(g.xAxisRange(), percentage), + valueRange: newYAxes[0] + }); } var v4Active = false; -- 2.7.4