mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-03 01:12:42 +08:00
fix layout err when type changed (#5865)
This commit is contained in:
@@ -170,6 +170,7 @@ export class UIRenderComponent extends UIComponent {
|
||||
type: Material,
|
||||
displayOrder: 3,
|
||||
tooltip:'源材质',
|
||||
visible: false,
|
||||
})
|
||||
get sharedMaterial () {
|
||||
return this._sharedMaterial;
|
||||
|
||||
@@ -1080,7 +1080,7 @@ export class LayoutComponent extends Component {
|
||||
const newWidth = this._getHorizontalBaseWidth(this.node.children);
|
||||
|
||||
const fnPositionY = (child: INode) => {
|
||||
const pos = this._isAlign ? this.node.position : child.position;
|
||||
const pos = this._isAlign ? Vec3.ZERO : child.position;
|
||||
return pos.y;
|
||||
};
|
||||
|
||||
@@ -1091,7 +1091,7 @@ export class LayoutComponent extends Component {
|
||||
const newHeight = this._getVerticalBaseHeight(this.node.children);
|
||||
|
||||
const fnPositionX = (child: INode) => {
|
||||
const pos = this._isAlign ? this.node.position : child.position;
|
||||
const pos = this._isAlign ? Vec3.ZERO : child.position;
|
||||
return pos.x;
|
||||
};
|
||||
|
||||
|
||||
@@ -190,6 +190,10 @@ export class MaskComponent extends UIRenderComponent {
|
||||
}
|
||||
|
||||
set segments (value) {
|
||||
if(this._segments === value){
|
||||
return;
|
||||
}
|
||||
|
||||
this._segments = clamp(value, SEGEMENTS_MIN, SEGEMENTS_MAX);
|
||||
this._updateGraphics();
|
||||
}
|
||||
|
||||
@@ -210,8 +210,8 @@ export class PageViewComponent extends ScrollViewComponent {
|
||||
}
|
||||
|
||||
this._indicator = value;
|
||||
if (this.indicator) {
|
||||
this.indicator.setPageView(this);
|
||||
if (this._indicator) {
|
||||
this._indicator.setPageView(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user