+ let iterMax = gPref.getIntPref("mandelbrot.iteration_max");
+ let algorithm = gPref.getCharPref("mandelbrot.use_algorithm");
+
+ let iWidth = 0;
+ try {
+ iWidth = gPref.getIntPref("mandelbrot.image.width");
+ }
+ catch (e) { }
+ if ((iWidth < 10) || (iWidth > 5000)) {
+ iWidth = 300;
+ gPref.setIntPref("mandelbrot.image.width", iWidth);
+ }
+ let iHeight = 0;
+ try {
+ iHeight = gPref.getIntPref("mandelbrot.image.height");
+ }
+ catch (e) { }
+ if ((iHeight < 10) || (iHeight > 5000)) {
+ iHeight = 300;
+ gPref.setIntPref("mandelbrot.image.height", iHeight);
+ }
+
+ canvas.width = iWidth;
+ canvas.height = iHeight;
+
+ context.fillStyle = "rgba(255, 255, 255, 127)";
+ context.fillRect(0, 0, canvas.width, canvas.height);