Skip to content

Commit d677adc

Browse files
committed
textureData updated to fix flipping property for webgl
1 parent 5810754 commit d677adc

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/webgl/p5.Texture.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,12 @@ p5.Texture = class Texture {
126126
this.isSrcHTMLElement
127127
) {
128128
// if param is a video HTML element
129-
textureData = this.src.elt;
129+
// UPDATED:
130+
if (this.src._ensureCanvas) {
131+
this.src._ensureCanvas()
132+
}
133+
textureData = this.src.canvas || this.src.elt;
134+
// End update
130135
} else if (this.isImageData) {
131136
textureData = this.src;
132137
}

0 commit comments

Comments
 (0)