refactor: opt
This commit is contained in:
parent
841c8c9c52
commit
9fafe9cda8
|
@ -266,13 +266,14 @@ export default () => class Visible extends decorate(Trait) {
|
|||
}
|
||||
|
||||
onZIndexChanged(zIndex) {
|
||||
if (!this.#container) {
|
||||
return;
|
||||
}
|
||||
this.#usingAutoZIndex = AUTO_ZINDEX === zIndex;
|
||||
if (!this.#usingAutoZIndex) {
|
||||
if (this.#container) {
|
||||
this.#container.zIndex = zIndex;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
packets() {
|
||||
const {isVisible, opacity, rotation} = this.stateDifferences();
|
||||
|
@ -335,11 +336,9 @@ export default () => class Visible extends decorate(Trait) {
|
|||
}
|
||||
this.#container.position = this.entity.position;
|
||||
if (this.#usingAutoZIndex) {
|
||||
if (this.#container) {
|
||||
this.#container.zIndex = this.entity.y;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
get visibleScaleX() {
|
||||
return this.state.visibleScale[0];
|
||||
|
|
Loading…
Reference in New Issue
Block a user