From 3e3d9a1d1c51a41435682714a8d601bf641629b5 Mon Sep 17 00:00:00 2001 From: Robert Kaiser Date: Sun, 16 Jan 2011 17:31:40 +0100 Subject: [PATCH] remove prompt for zooming --- .../chrome/mandelbrot/content/mandelbrot.js | 29 +++++++------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/xulapp/chrome/mandelbrot/content/mandelbrot.js b/xulapp/chrome/mandelbrot/content/mandelbrot.js index 24f9a0c..0a4a31a 100644 --- a/xulapp/chrome/mandelbrot/content/mandelbrot.js +++ b/xulapp/chrome/mandelbrot/content/mandelbrot.js @@ -442,24 +442,17 @@ function mouseevent(etype, event) { if (zoomend.y < zoomstart.y) [zoomend.y, zoomstart.y] = [zoomstart.y, zoomend.y]; - let prompts = Components.classes["@mozilla.org/embedcomp/prompt-service;1"] - .getService(Components.interfaces.nsIPromptService); - let ok = prompts.confirm(null, gMbrotBundle.getString("zoomConfirmTitle"), - gMbrotBundle.getString("zoomConfirmLabel")); - // ok is now true if OK was clicked, and false if cancel was clicked - if (ok) { - // determine new "coordinates" - let CWidth = gCurrentImageData.C_max.r - gCurrentImageData.C_min.r; - let CHeight = gCurrentImageData.C_max.i - gCurrentImageData.C_min.i; - let newC_min = new complex( - gCurrentImageData.C_min.r + zoomstart.x / gCurrentImageData.iWidth * CWidth, - gCurrentImageData.C_min.i + zoomstart.y / gCurrentImageData.iHeight * CHeight); - let newC_max = new complex( - gCurrentImageData.C_min.r + zoomend.x / gCurrentImageData.iWidth * CWidth, - gCurrentImageData.C_min.i + zoomend.y / gCurrentImageData.iHeight * CHeight); - - adjustCoordsAndDraw(newC_min, newC_max); - } + // determine new "coordinates" + let CWidth = gCurrentImageData.C_max.r - gCurrentImageData.C_min.r; + let CHeight = gCurrentImageData.C_max.i - gCurrentImageData.C_min.i; + let newC_min = new complex( + gCurrentImageData.C_min.r + zoomstart.x / gCurrentImageData.iWidth * CWidth, + gCurrentImageData.C_min.i + zoomstart.y / gCurrentImageData.iHeight * CHeight); + let newC_max = new complex( + gCurrentImageData.C_min.r + zoomend.x / gCurrentImageData.iWidth * CWidth, + gCurrentImageData.C_min.i + zoomend.y / gCurrentImageData.iHeight * CHeight); + + adjustCoordsAndDraw(newC_min, newC_max); } zoomstart = undefined; break; -- 2.43.0