make onPaint work with mutiple repls on screen

+ add warning if stock onPaint is not overloaded
This commit is contained in:
Felix Roos 2024-03-19 08:44:05 +01:00
parent 29cb6195b3
commit 6b98e414c6
2 changed files with 10 additions and 11 deletions

View file

@ -96,9 +96,8 @@ export const cleanupDraw = (clearScreen = true) => {
}
};
Pattern.prototype.onPaint = function (onPaint) {
// this is evil! TODO: add pattern.context
this.context = { onPaint };
Pattern.prototype.onPaint = function () {
console.warn('[draw] onPaint was not overloaded. Some drawings might not work');
return this;
};