Fix that slider bug
This commit is contained in:
parent
982b863802
commit
a028e009d6
@ -1,7 +1,7 @@
|
|||||||
const MIN_ZOOM = 0.0001;
|
const MIN_ZOOM = 0.0001;
|
||||||
const MAX_ZOOM = 4;
|
const MAX_ZOOM = 4;
|
||||||
const C_THRESHOLD = Math.sqrt(2)/2;
|
const C_THRESHOLD = Math.sqrt(2)/2;
|
||||||
const SLIDER_DIV = 1000*C_THRESHOLD;
|
const SLIDER_DIV = 2000*C_THRESHOLD;
|
||||||
|
|
||||||
const gpu = new GPU();
|
const gpu = new GPU();
|
||||||
const buildRender = (width, height) => gpu.createKernel(function (maxIterations, cr, ci, centerX, centerY, zoom, colorMultipliers) {
|
const buildRender = (width, height) => gpu.createKernel(function (maxIterations, cr, ci, centerX, centerY, zoom, colorMultipliers) {
|
||||||
@ -81,6 +81,7 @@ const startAnim = (sliderId, complexComponentName='ci') => {
|
|||||||
};
|
};
|
||||||
const start = setInterval(() => {
|
const start = setInterval(() => {
|
||||||
if (state[complexComponentName] >= C_THRESHOLD) {
|
if (state[complexComponentName] >= C_THRESHOLD) {
|
||||||
|
console.log("OVER", C_THRESHOLD);
|
||||||
restart(start);
|
restart(start);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -90,12 +91,12 @@ const startAnim = (sliderId, complexComponentName='ci') => {
|
|||||||
document.getElementById(sliderId).onclick = ()=>restart(start);
|
document.getElementById(sliderId).onclick = ()=>restart(start);
|
||||||
};
|
};
|
||||||
|
|
||||||
document.getElementById('realSlider').oninput = function() {
|
|
||||||
state.changes.cr = parseFloat(this.value) / SLIDER_DIV;
|
|
||||||
};
|
|
||||||
document.getElementById('imaginarySlider').oninput = function() {
|
document.getElementById('imaginarySlider').oninput = function() {
|
||||||
state.changes.ci = parseFloat(this.value) / SLIDER_DIV;
|
state.changes.ci = parseFloat(this.value) / SLIDER_DIV;
|
||||||
};
|
};
|
||||||
|
document.getElementById('realSlider').oninput = function() {
|
||||||
|
state.changes.cr = parseFloat(this.value) / SLIDER_DIV;
|
||||||
|
};
|
||||||
|
|
||||||
document.getElementById('imag-val').addEventListener('change', function (e) {
|
document.getElementById('imag-val').addEventListener('change', function (e) {
|
||||||
state.changes.ci = parseFloat(this.value);
|
state.changes.ci = parseFloat(this.value);
|
||||||
|
Loading…
Reference in New Issue
Block a user