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