@galacean/engine-core 0.0.0-experimental-renderSort.2 → 0.0.0-experimental-renderSort.4
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/dist/main.js +14 -3
- package/dist/main.js.map +1 -1
- package/dist/miniprogram.js +14 -3
- package/dist/module.js +14 -3
- package/dist/module.js.map +1 -1
- package/package.json +3 -3
package/dist/main.js
CHANGED
|
@@ -21866,7 +21866,7 @@ var passNum = 0;
|
|
|
21866
21866
|
*/ _proto._quickSort = function _quickSort(a, from, to, compareFunc) {
|
|
21867
21867
|
while(true){
|
|
21868
21868
|
// Insertion sort is faster for short arrays.
|
|
21869
|
-
if (to - from <=
|
|
21869
|
+
if (to - from <= 10) {
|
|
21870
21870
|
this._insertionSort(a, from, to, compareFunc);
|
|
21871
21871
|
return;
|
|
21872
21872
|
}
|
|
@@ -21973,7 +21973,12 @@ var passNum = 0;
|
|
|
21973
21973
|
if (componentA.instanceId === componentB.instanceId) {
|
|
21974
21974
|
return dataA.material._priority - dataB.material._priority || componentA._distanceForSort - componentB._distanceForSort;
|
|
21975
21975
|
} else {
|
|
21976
|
-
|
|
21976
|
+
var distanceDiff = componentA._distanceForSort - componentB._distanceForSort;
|
|
21977
|
+
if (distanceDiff === 0) {
|
|
21978
|
+
return componentA.instanceId - componentB.instanceId;
|
|
21979
|
+
} else {
|
|
21980
|
+
return distanceDiff;
|
|
21981
|
+
}
|
|
21977
21982
|
}
|
|
21978
21983
|
};
|
|
21979
21984
|
/**
|
|
@@ -21991,7 +21996,13 @@ var passNum = 0;
|
|
|
21991
21996
|
if (componentA.instanceId === componentB.instanceId) {
|
|
21992
21997
|
return dataA.material._priority - dataB.material._priority || componentB._distanceForSort - componentA._distanceForSort;
|
|
21993
21998
|
} else {
|
|
21994
|
-
return componentB._distanceForSort - componentA._distanceForSort;
|
|
21999
|
+
// return componentB._distanceForSort - componentA._distanceForSort;
|
|
22000
|
+
var distanceDiff = componentB._distanceForSort - componentA._distanceForSort;
|
|
22001
|
+
if (distanceDiff === 0) {
|
|
22002
|
+
return componentA.instanceId - componentB.instanceId;
|
|
22003
|
+
} else {
|
|
22004
|
+
return distanceDiff;
|
|
22005
|
+
}
|
|
21995
22006
|
}
|
|
21996
22007
|
};
|
|
21997
22008
|
return RenderQueue;
|