diff --git a/cocos/ui/layout.ts b/cocos/ui/layout.ts index 57e6c98669..ac64334a89 100644 --- a/cocos/ui/layout.ts +++ b/cocos/ui/layout.ts @@ -1144,11 +1144,10 @@ export class Layout extends Component { } protected _transformDirty (type: TransformBit): void { - if (!(type & TransformBit.SCALE) || !(type & TransformBit.POSITION) || !this._affectedByScale) { - return; + // Invalidate layout when scale is affected and changed, or position is changed. + if ((type & TransformBit.SCALE && this._affectedByScale) || (type & TransformBit.POSITION)) { + this._doLayoutDirty(); } - - this._doLayoutDirty(); } protected _doLayoutDirty (): void {