Преглед на файлове

Fix bug in DynamicFloatArray.sort()

nockawa преди 9 години
родител
ревизия
8aa34ac2c6
променени са 1 файла, в които са добавени 4 реда и са изтрити 1 реда
  1. 4 1
      src/Tools/babylon.dynamicFloatArray.ts

+ 4 - 1
src/Tools/babylon.dynamicFloatArray.ts

@@ -259,7 +259,10 @@
                 let newCount = Math.min(this.totalElementCount, count * 2);
 
                 this._sortTable = new Array<SortInfo>(newCount);
-                this._sortedTable = new Array<SortInfo>(newCount);
+            }
+
+            if (!this._sortTable || this._sortTable.length !== count) {
+                this._sortedTable = new Array<SortInfo>(count);
             }
 
             // Because, you know...