Skip to content

Commit 3e1eae2

Browse files
authored
Merge pull request #5090 from msub2/main
Add check for TypedArrays in applyMatrix()
2 parents 19fa310 + 3bbe9a7 commit 3e1eae2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/core/transform.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,8 @@ import p5 from './main';
156156
* A rectangle in the upper left corner
157157
*/
158158
p5.prototype.applyMatrix = function() {
159-
if (Array.isArray(arguments[0])) {
159+
let isTypedArray = arguments[0] instanceof Object.getPrototypeOf(Uint8Array);
160+
if (Array.isArray(arguments[0]) || isTypedArray) {
160161
this._renderer.applyMatrix(...arguments[0]);
161162
} else {
162163
this._renderer.applyMatrix(...arguments);

0 commit comments

Comments
 (0)