refactor: sync position after initialization
This commit is contained in:
parent
80d808a921
commit
fbc0ab5583
|
@ -20,6 +20,9 @@ class GraphicalBase extends Trait {
|
|||
this._container = new Container();
|
||||
}
|
||||
this.trackPosition = this.params.get('trackPosition');
|
||||
}
|
||||
|
||||
hasInitialized() {
|
||||
if (this.shouldSynchronizePosition()) {
|
||||
this.synchronizePosition();
|
||||
}
|
||||
|
@ -35,7 +38,7 @@ class GraphicalBase extends Trait {
|
|||
|
||||
synchronizePosition() {
|
||||
if ('position' in this.entity) {
|
||||
this._container.position = this.entity.position;
|
||||
this.entity.container.position = this.entity.position;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user