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: wrong check caused setting a new texture not to work if not yet loaded #40

Merged
merged 1 commit into from
May 18, 2022

Conversation

trusktr
Copy link
Contributor

@trusktr trusktr commented May 6, 2022

The missing .value was causing that conditional branch to never run, so trying to do the following wasn't working:

material.texture = new TextureLoader.load('foo.jpg') // does not wait for load, causes saveDimensions to result in [1,1]

Before this change it required a workaround:

new TextureLoader.load('foo.jpg', tex => {
  material.texture = tex // now it measures dimensions because the image is loaded
})

Copy link
Owner

@marcofugaro marcofugaro left a comment

Choose a reason for hiding this comment

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

oops, thank you!

@marcofugaro marcofugaro merged commit af105f1 into marcofugaro:master May 18, 2022
@trusktr trusktr deleted the patch-1 branch May 19, 2022 03:15
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.

None yet

2 participants