💡 Update bundle
This commit is contained in:
parent
7019b4c40a
commit
b47f30951d
28
bundle.js
28
bundle.js
|
@ -637,33 +637,9 @@ function _typeof(obj) { return obj && typeof Symbol !== "undefined" && obj.const
|
||||||
// => newCenter = mouse * zoom - mouse * newZoom + center
|
// => newCenter = mouse * zoom - mouse * newZoom + center
|
||||||
center = [mouse[0] * zoom - mouse[0] * newZoom + center[0], mouse[1] * zoom - mouse[1] * newZoom + center[1]];
|
center = [mouse[0] * zoom - mouse[0] * newZoom + center[0], mouse[1] * zoom - mouse[1] * newZoom + center[1]];
|
||||||
|
|
||||||
if (newZoom > zoom) {
|
|
||||||
_chaos.applyChaos.apply(undefined, [points, Math.floor((newZoom - zoom) * 1000)].concat(_toConsumableArray(_ifs.sierpinski)));
|
|
||||||
} else {
|
|
||||||
// points = points.slice(0, points.length + Math.floor((newZoom - zoom) * 1000));
|
|
||||||
}
|
|
||||||
|
|
||||||
zoom = newZoom;
|
zoom = newZoom;
|
||||||
|
|
||||||
// time for some GC
|
|
||||||
if (points.length > 1000000) {
|
|
||||||
var length = points.length;
|
|
||||||
var newPoints = [];
|
|
||||||
var i = 0;
|
|
||||||
|
|
||||||
for (i = 0; i < length; i += 1) {
|
|
||||||
var x = Math.floor(points[i][0] * zoom + center[0]);
|
|
||||||
var y = height - Math.floor(points[i][1] * zoom + center[1]);
|
|
||||||
|
|
||||||
if (x >= 0 && x < width && y >= 0 && y < height) {
|
|
||||||
newPoints.push(points[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
points = newPoints;
|
|
||||||
}
|
|
||||||
|
|
||||||
render();
|
render();
|
||||||
|
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -691,7 +667,7 @@ function _typeof(obj) { return obj && typeof Symbol !== "undefined" && obj.const
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
_chaos.applyChaos.apply(undefined, [points, 200000].concat(_toConsumableArray(_ifs.sierpinski)));
|
_chaos.applyChaos.apply(undefined, [points, 200000].concat(_toConsumableArray(_ifs.barnsley)));
|
||||||
window.onresize = resize;
|
window.onresize = resize;
|
||||||
resize();
|
resize();
|
||||||
}, { "./chaos": 6, "./ifs": 7, "the-dom": 1 }] }, {}, [8]);
|
}, { "./chaos": 6, "./ifs": 7, "the-dom": 1 }] }, {}, [8]);
|
||||||
|
|
Loading…
Reference in New Issue