在隐藏的情况下修改了锚点导致裁剪不正确了,看了下源码
public onEnable () {
super.onEnable();
this._updateGraphics();
this._enableGraphics();
this._changeRenderType();
this.node.on(NodeEventType.SIZE_CHANGED, this._sizeChange, this);
this.node.on(NodeEventType.ANCHOR_CHANGED, this._anchorChange, this);
this.node.on(NodeEventType.SIBLING_ORDER_CHANGED, this._siblingChange, this);
this.node.on(NodeEventType.LAYER_CHANGED, this._layerChange, this);
this._sizeChange();
this._siblingChange();
this._layerChange();
//_anchorChange呢
}
其他三个属性变化都有在onEnable时刷新一下,为啥就锚点不刷新