mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 20:11:24 +08:00
case statements fix
This commit is contained in:
@ -720,7 +720,8 @@ export class View extends ProxyObject implements definition.View {
|
|||||||
childTop = top + marginTop * density;
|
childTop = top + marginTop * density;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case enums.VerticalAlignment.center || enums.VerticalAlignment.middle:
|
case enums.VerticalAlignment.center:
|
||||||
|
case enums.VerticalAlignment.middle:
|
||||||
childTop = top + (bottom - top - childHeight + (marginTop - marginBottom) * density) / 2;
|
childTop = top + (bottom - top - childHeight + (marginTop - marginBottom) * density) / 2;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -586,7 +586,8 @@ export class ViewStyler implements style.Styler {
|
|||||||
gravity |= android.view.Gravity.TOP;
|
gravity |= android.view.Gravity.TOP;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case enums.VerticalAlignment.center || enums.VerticalAlignment.middle:
|
case enums.VerticalAlignment.center:
|
||||||
|
case enums.VerticalAlignment.middle:
|
||||||
gravity |= android.view.Gravity.CENTER_VERTICAL;
|
gravity |= android.view.Gravity.CENTER_VERTICAL;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -110,7 +110,8 @@ export class StackLayout extends common.StackLayout {
|
|||||||
var childRight = right - left - paddingRight;
|
var childRight = right - left - paddingRight;
|
||||||
|
|
||||||
switch (this.verticalAlignment) {
|
switch (this.verticalAlignment) {
|
||||||
case VerticalAlignment.center || VerticalAlignment.middle:
|
case VerticalAlignment.center:
|
||||||
|
case VerticalAlignment.middle:
|
||||||
childTop = (bottom - top - this._totalLength) / 2 + paddingTop - paddingBottom;
|
childTop = (bottom - top - this._totalLength) / 2 + paddingTop - paddingBottom;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -169,4 +170,4 @@ export class StackLayout extends common.StackLayout {
|
|||||||
childLeft += childWidth;
|
childLeft += childWidth;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user