Просмотр исходного кода

Fix bug in GlowLayer.unReferenceMeshFromUsingItsOwnMaterial

Popov72 5 лет назад
Родитель
Сommit
dde1ad50b9
2 измененных файлов с 4 добавлено и 2 удалено
  1. 2 0
      dist/preview release/what's new.md
  2. 2 2
      src/Layers/glowLayer.ts

+ 2 - 0
dist/preview release/what's new.md

@@ -10,4 +10,6 @@
 
 ## Bugs
 
+- Fix infinite loop in `GlowLayer.unReferenceMeshFromUsingItsOwnMaterial` ([Popov72](https://github.com/Popov72)
+
 ## Breaking changes

+ 2 - 2
src/Layers/glowLayer.ts

@@ -536,8 +536,8 @@ export class GlowLayer extends EffectLayer {
      */
     public unReferenceMeshFromUsingItsOwnMaterial(mesh: AbstractMesh): void {
         let index = this._meshesUsingTheirOwnMaterials.indexOf(mesh.uniqueId);
-        while (index > 0) {
-            this._meshesUsingTheirOwnMaterials.slice(index, index + 1);
+        while (index >= 0) {
+            this._meshesUsingTheirOwnMaterials.splice(index, 1);
             index = this._meshesUsingTheirOwnMaterials.indexOf(mesh.uniqueId);
         }
     }