better draw cleanup + began reference tab

This commit is contained in:
Felix Roos 2022-11-13 14:50:48 +01:00
parent 8f31fbe275
commit c92cb1c096
9 changed files with 178 additions and 127 deletions

View file

@ -49,9 +49,9 @@ Pattern.prototype.draw = function (callback, { from, to, onQuery }) {
return this;
};
export const cleanupDraw = () => {
export const cleanupDraw = (clearScreen = true) => {
const ctx = getDrawContext();
ctx.clearRect(0, 0, window.innerWidth, window.innerHeight);
clearScreen && ctx.clearRect(0, 0, window.innerWidth, window.innerHeight);
if (window.strudelAnimation) {
cancelAnimationFrame(window.strudelAnimation);
}