pixi.js
Version:
<p align="center"> <a href="https://pixijs.com" target="_blank" rel="noopener noreferrer"> <img height="150" src="https://files.pixijs.download/branding/pixijs-logo-transparent-dark.svg?v=1" alt="PixiJS logo"> </a> </p> <br/> <p align="center">
37 lines (35 loc) • 767 B
JavaScript
"use strict";
const sortMixin = {
_zIndex: 0,
sortDirty: false,
sortableChildren: false,
get zIndex() {
return this._zIndex;
},
set zIndex(value) {
if (this._zIndex === value)
return;
this._zIndex = value;
this.depthOfChildModified();
},
depthOfChildModified() {
if (this.parent) {
this.parent.sortableChildren = true;
this.parent.sortDirty = true;
}
if (this.parentRenderGroup) {
this.parentRenderGroup.structureDidChange = true;
}
},
sortChildren() {
if (!this.sortDirty)
return;
this.sortDirty = false;
this.children.sort(sortChildren);
}
};
function sortChildren(a, b) {
return a._zIndex - b._zIndex;
}
export { sortMixin };
//# sourceMappingURL=sortMixin.mjs.map