opt: internal
This commit is contained in:
parent
cf90676890
commit
06ef49fa68
|
@ -212,14 +212,14 @@ export default class Container extends Renderable {
|
|||
return;
|
||||
}
|
||||
let needsSort = false;
|
||||
let currentZ = this.$$children[0].zIndex;
|
||||
let currentZ = this.$$children[0].$$zIndex;
|
||||
for (let i = 0; i < this.$$children.length; i++) {
|
||||
const child = this.$$children[i];
|
||||
if (currentZ > child.zIndex) {
|
||||
if (currentZ > child.$$zIndex) {
|
||||
needsSort = true;
|
||||
break;
|
||||
}
|
||||
currentZ = child.zIndex;
|
||||
currentZ = child.$$zIndex;
|
||||
}
|
||||
if (!needsSort) {
|
||||
return;
|
||||
|
@ -240,14 +240,7 @@ export default class Container extends Renderable {
|
|||
child.sort();
|
||||
}
|
||||
}
|
||||
this.$$children.sort((l, r) => {
|
||||
if (l.zIndex !== r.zIndex) {
|
||||
return l.zIndex - r.zIndex;
|
||||
}
|
||||
const lIndex = this.$$children.indexOf(l);
|
||||
const rIndex = this.$$children.indexOf(r);
|
||||
return lIndex - rIndex;
|
||||
});
|
||||
this.$$children.sort((l, r) => l.$$zIndex - r.$$zIndex);
|
||||
if (!this.container.isFake) {
|
||||
this.container.children = this.$$children.map((child) => child.internal);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user