Skip to content

Conversation

@pecoram
Copy link
Contributor

@pecoram pecoram commented Dec 12, 2024

No description provided.

((typeof obj === 'object' &&
obj.constructor &&
obj.constructor.name === 'HTMLImageElement') ||
obj instanceof HTMLImageElement)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would it be safe/better to do the instanceof check first?

((typeof obj === 'object' &&
obj.constructor &&
obj.constructor.name === 'HTMLImageElement') ||
(typeof HTMLImageElement !== 'undefined' &&
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hopefully this works if we're rendering in a webworker again - though granted if we're doing offscreen rendering the chances are that we're using Canvas rendering are quite low.

That plus ThreadX being months out from a useable state again, its fine.

@wouterlucas wouterlucas merged commit b90b724 into lightning-js:main Dec 16, 2024
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants