Skip to content

Commit

Permalink
dispatch a textureload event when texture load is detected so people …
Browse files Browse the repository at this point in the history
…know when to do things (f.e. to re-render a scene) (#44)
  • Loading branch information
trusktr authored Jan 30, 2023
1 parent 1a895de commit 0129a36
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/ProjectedMaterial.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export default class ProjectedMaterial extends THREE.MeshPhysicalMaterial {
this.uniforms.isTextureLoaded.value = true

this.#saveDimensions()
this.dispatchEvent({ type: 'textureload' })
})
} else {
this.#saveDimensions()
Expand Down Expand Up @@ -242,6 +243,7 @@ export default class ProjectedMaterial extends THREE.MeshPhysicalMaterial {
this.uniforms.isTextureLoaded.value = true

this.#saveDimensions()
this.dispatchEvent({ type: 'textureload' })
})
}

Expand Down

0 comments on commit 0129a36

Please sign in to comment.