canvas update + demo

This commit is contained in:
2023-03-04 20:02:15 +01:00
parent 92a4decd8f
commit b716a56e26
2 changed files with 113 additions and 1 deletions
+8 -1
View File
@@ -242,7 +242,14 @@ class RepaTexture extends HTMLElement {
}
get shouldUpdate() {
return this.ready && (this._forceUpdate || (this.ref && this.ref instanceof HTMLVideoElement && this.ref.readyState === this.ref.HAVE_ENOUGH_DATA));
return this.ready &&
(this._forceUpdate || (
this.ref && (
(this.ref instanceof HTMLVideoElement && this.ref.readyState === this.ref.HAVE_ENOUGH_DATA) ||
(this.ref instanceof HTMLCanvasElement)
)
)
);
}
get width() {