Skip to content

Commit 630bc8e

Browse files
committed
Make old findCanvasEventTarget work with OffscreenCanvases
1 parent 4da28fe commit 630bc8e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/library_html5.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,10 +338,10 @@ var LibraryJSEvents = {
338338
_findCanvasEventTarget: function(target) {
339339
if (typeof target === 'number') target = UTF8ToString(target);
340340
if (!target || target === '#canvas') {
341-
if (typeof GL !== 'undefined' && GL.offscreenCanvases['canvas']) return GL.offscreenCanvases['canvas']; // TODO: Remove this line, target '#canvas' should refer only to Module['canvas'], not to GL.offscreenCanvases['canvas'] - but need stricter tests to be able to remove this line.
341+
if (typeof GL !== 'undefined' && GL.offscreenCanvases['canvas']) return GL.offscreenCanvases['canvas']['offscreenCanvas']; // TODO: Remove this line, target '#canvas' should refer only to Module['canvas'], not to GL.offscreenCanvases['canvas'] - but need stricter tests to be able to remove this line.
342342
return Module['canvas'];
343343
}
344-
if (typeof GL !== 'undefined' && GL.offscreenCanvases[target]) return GL.offscreenCanvases[target];
344+
if (typeof GL !== 'undefined' && GL.offscreenCanvases[target]) return GL.offscreenCanvases[target]['offscreenCanvas'];
345345
return __findEventTarget(target);
346346
},
347347
#endif

0 commit comments

Comments
 (0)