var gColorPalette = [];
function initSettings() {
+ recalcCoord('Cr', 'scale');
+ recalcCoord('Ci', 'scale');
}
function drawPreview() {
drawLine(0, [Cr_min, Cr_max, Ci_min, Ci_max],
canvas, context, iterMax, algorithm);
}
+
+function recalcCoord(coord, target) {
+ if (target == 'scale') {
+ document.getElementById(coord + '_scale').value =
+ parseFloat(document.getElementById(coord + '_max').value) -
+ parseFloat(document.getElementById(coord + '_min').value);
+ }
+ else if (target == 'max') {
+ document.getElementById('mandelbrot.last_image.' + coord + '_max').value =
+ parseFloat(document.getElementById(coord + '_min').value) +
+ parseFloat(document.getElementById(coord + '_scale').value);
+ }
+}
\ No newline at end of file