block based eval

This commit is contained in:
Dsm0 2025-12-23 01:47:06 -08:00
parent 5a51b4ec71
commit fd1e3d248a
13 changed files with 1106 additions and 200 deletions

View file

@ -78,6 +78,16 @@ export const cleanupDraw = (clearScreen = true, id) => {
stopAllAnimations(id);
};
export const cleanupDrawContext = (replID) => {
const ctx = getDrawContext();
ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);
// clear the big canvas context, ignore inline widgets
Object.keys(animationFrames).forEach((id) =>
(!replID || id.startsWith(replID)) && !id.startsWith('_') && stopAnimationFrame(id)
);
};
Pattern.prototype.onPaint = function (painter) {
return this.withState((state) => {
if (!state.controls.painters) {