mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-02 08:42:43 +08:00
TiledLayer should watch parent node position (#7857)
This commit is contained in:
@@ -390,13 +390,19 @@ export class TiledLayer extends UIRenderable {
|
||||
super.onEnable();
|
||||
this.node.on(SystemEventType.ANCHOR_CHANGED, this._syncAnchorPoint, this);
|
||||
this.node.on(SystemEventType.TRANSFORM_CHANGED, this.updateCulling, this);
|
||||
this.node.on(SystemEventType.SIZE_CHANGED, this.updateCulling, this);
|
||||
this.node.parent!.on(SystemEventType.TRANSFORM_CHANGED, this.updateCulling, this);
|
||||
this.node.parent!.on(SystemEventType.SIZE_CHANGED, this.updateCulling, this);
|
||||
this.markForUpdateRenderData();
|
||||
}
|
||||
|
||||
onDisable () {
|
||||
super.onDisable();
|
||||
this.node.off(SystemEventType.ANCHOR_CHANGED, this._syncAnchorPoint, this);
|
||||
this.node.parent!.off(SystemEventType.SIZE_CHANGED, this.updateCulling, this);
|
||||
this.node.parent!.off(SystemEventType.TRANSFORM_CHANGED, this.updateCulling, this);
|
||||
this.node.off(SystemEventType.SIZE_CHANGED, this.updateCulling, this);
|
||||
this.node.off(SystemEventType.TRANSFORM_CHANGED, this.updateCulling, this);
|
||||
this.node.off(SystemEventType.ANCHOR_CHANGED, this._syncAnchorPoint, this);
|
||||
}
|
||||
|
||||
protected _syncAnchorPoint () {
|
||||
|
||||
Reference in New Issue
Block a user