mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-17 21:01:34 +08:00
Merge pull request #1823 from alg/case-fix
Fixes incorrectly formed switch-case statements
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;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user