@mml-io/mml-web-client 0.0.0-experimental-cd42b86-20250207 → 0.0.0-experimental-c1742ea-20250219

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/index.js CHANGED
@@ -97231,10 +97231,13 @@ void main() {
97231
97231
  this.mesh.castShadow = castShadows;
97232
97232
  }
97233
97233
  setOpacity(opacity) {
97234
- const needsUpdate = this.material.transparent === (opacity === 1);
97235
- this.material.transparent = opacity !== 1;
97236
- this.material.needsUpdate = needsUpdate;
97234
+ const shouldBeTransparent = opacity !== 1 || this.loadedImageHasTransparency;
97235
+ const needsUpdate = this.material.transparent !== shouldBeTransparent;
97236
+ this.material.transparent = shouldBeTransparent;
97237
97237
  this.material.opacity = opacity;
97238
+ if (needsUpdate) {
97239
+ this.material.needsUpdate = true;
97240
+ }
97238
97241
  }
97239
97242
  setEmissive() {
97240
97243
  this.updateMaterialEmissiveIntensity();
@@ -97327,15 +97330,9 @@ void main() {
97327
97330
  if (!this.material) {
97328
97331
  return;
97329
97332
  }
97330
- if (this.loadedImageHasTransparency) {
97331
- this.material.alphaMap = new CanvasTexture(this.loadedImage);
97332
- this.material.alphaTest = 0.01;
97333
- } else {
97334
- this.material.alphaMap = null;
97335
- this.material.alphaTest = 0;
97336
- }
97337
- this.material.transparent = this.image.props.opacity !== 1 || this.loadedImageHasTransparency;
97338
97333
  this.material.map = new CanvasTexture(this.loadedImage);
97334
+ this.material.transparent = this.image.props.opacity !== 1 || this.loadedImageHasTransparency;
97335
+ this.material.alphaTest = 0.01;
97339
97336
  this.material.needsUpdate = true;
97340
97337
  this.updateMaterialEmissiveIntensity();
97341
97338
  this.updateWidthAndHeight();