FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix(flexbox): justify content calculations · NativeScript/NativeScript@7b202df · GitHub

Commit 7b202df

Browse files
committed
fix(flexbox): justify content calculations
1 parent f3ea75f commit 7b202df

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

‎tns-core-modules/ui/layouts/flexbox-layout/flexbox-layout.ios.ts‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1164,24 +1164,24 @@ export class FlexboxLayout extends FlexboxLayoutBase {
11641164
childBottom = height - paddingBottom;
11651165
break;
11661166
case JustifyContent.FLEX_END:
1167-
childTop = height - flexLine._mainSize + paddingBottom;
1168-
childBottom = flexLine._mainSize - paddingTop;
1167+
childTop = height - flexLine._mainSize - paddingBottom;
1168+
childBottom = flexLine._mainSize + paddingTop;
11691169
break;
11701170
case JustifyContent.CENTER:
1171-
childTop = paddingTop + (height - flexLine._mainSize) / 2.0;
1172-
childBottom = height - paddingBottom - (height - flexLine._mainSize) / 2.0;
1171+
childTop = paddingTop + (height - insets.top - insets.bottom - flexLine._mainSize) / 2.0;
1172+
childBottom = height - paddingBottom - (height - insets.top - insets.bottom - flexLine._mainSize) / 2.0;
11731173
break;
11741174
case JustifyContent.SPACE_AROUND:
11751175
if (flexLine._itemCount !== 0) {
1176-
spaceBetweenItem = (height - flexLine._mainSize) / flexLine.itemCount;
1176+
spaceBetweenItem = (height - insets.top - insets.bottom - flexLine._mainSize) / flexLine.itemCount;
11771177
}
11781178
childTop = paddingTop + spaceBetweenItem / 2.0;
11791179
childBottom = height - paddingBottom - spaceBetweenItem / 2.0;
11801180
break;
11811181
case JustifyContent.SPACE_BETWEEN:
11821182
childTop = paddingTop;
11831183
let denominator = flexLine.itemCount !== 1 ? flexLine.itemCount - 1 : 1.0;
1184-
spaceBetweenItem = (height - flexLine.mainSize) / denominator;
1184+
spaceBetweenItem = (height - insets.top - insets.bottom - flexLine.mainSize) / denominator;
11851185
childBottom = height - paddingBottom;
11861186
break;
11871187
default:

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL