Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/lib/libhtml5.js
Original file line number Diff line number Diff line change
Expand Up @@ -415,10 +415,10 @@ var LibraryHTML5 = {
$findCanvasEventTarget: (target) => {
if (typeof target == 'number') target = UTF8ToString(target);
if (!target || target === '#canvas') {
if (globalThis.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.
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.
return Module['canvas'];
}
if (globalThis.GL?.offscreenCanvases[target]) return GL.offscreenCanvases[target];
if (typeof GL != 'undefined' && GL.offscreenCanvases[target]) return GL.offscreenCanvases[target];
return findEventTarget(target);
},
#endif
Expand Down