From: Robert Kaiser Date: Thu, 6 Aug 2009 10:46:12 +0000 (+0200) Subject: correct clamping values in a way that the overview 'bookmark' works with correct... X-Git-Url: https://git-public.kairo.at/?a=commitdiff_plain;h=305865993932a42afc891deb5acc046b62949c9e;p=mandelbrot.git correct clamping values in a way that the overview 'bookmark' works with correct proportional values for all common image proportions (esp. up to 16:9) --- diff --git a/xulapp/chrome/mandelbrot/content/mandelbrot.js b/xulapp/chrome/mandelbrot/content/mandelbrot.js index c0a8c1c..788e198 100644 --- a/xulapp/chrome/mandelbrot/content/mandelbrot.js +++ b/xulapp/chrome/mandelbrot/content/mandelbrot.js @@ -83,7 +83,7 @@ function adjustCoordsAndDraw(aC_min, aC_max) { if (aC_max.i > 2) aC_max.i = 2; if ((aC_min.i > 2) || (aC_max.i < -2) || (aC_min.i >= aC_max.i)) { - aC_min.i = -1.5; aC_max.i = 1.5; + aC_min.i = -1.3; aC_max.i = 1.3; } let CWidth = aC_max.r - aC_min.r; @@ -115,8 +115,8 @@ function drawImage() { Cr_max = parseFloat(gPref.getCharPref("mandelbrot.last_image.Cr_max")); } catch (e) { } - if ((Cr_min < -2) || (Cr_min > 2) || - (Cr_max < -2) || (Cr_max > 2) || (Cr_min >= Cr_max)) { + if ((Cr_min < -3) || (Cr_min > 2) || + (Cr_max < -3) || (Cr_max > 2) || (Cr_min >= Cr_max)) { Cr_min = -2.0; Cr_max = 1.0; } gPref.setCharPref("mandelbrot.last_image.Cr_min", Cr_min); @@ -129,8 +129,8 @@ function drawImage() { Ci_max = parseFloat(gPref.getCharPref("mandelbrot.last_image.Ci_max")); } catch (e) { } - if ((Ci_min < -2) || (Ci_min > 2) || - (Ci_max < -2) || (Ci_max > 2) || (Ci_min >= Ci_max)) { + if ((Ci_min < -2.5) || (Ci_min > 2.5) || + (Ci_max < -2.5) || (Ci_max > 2.5) || (Ci_min >= Ci_max)) { Ci_min = -1.5; Ci_max = 1.5; } gPref.setCharPref("mandelbrot.last_image.Ci_min", Ci_min);