fix layout err when type changed (#5865)

This commit is contained in:
JoneLau
2019-12-07 22:36:15 +08:00
committed by pandamicro
parent 095e115413
commit ad6addecf9
4 changed files with 9 additions and 4 deletions
@@ -170,6 +170,7 @@ export class UIRenderComponent extends UIComponent {
type: Material,
displayOrder: 3,
tooltip:'源材质',
visible: false,
})
get sharedMaterial () {
return this._sharedMaterial;
+2 -2
View File
@@ -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;
};
+4
View File
@@ -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();
}
+2 -2
View File
@@ -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);
}
}