refactor: opt
This commit is contained in:
parent
841c8c9c52
commit
9fafe9cda8
|
@ -266,11 +266,12 @@ 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;
|
||||
}
|
||||
this.#container.zIndex = zIndex;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -335,9 +336,7 @@ 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;
|
||||
}
|
||||
this.#container.zIndex = this.entity.y;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user