Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: safari 9 HTMLImageElement check #473

Merged
merged 6 commits into from
Dec 16, 2024

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.

src/core/textures/ImageTexture.ts Show resolved Hide resolved
@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