From 726c5bb913c00ebffd904e3cbeb5373a90727314 Mon Sep 17 00:00:00 2001 From: Vasil Chimev Date: Wed, 25 Jul 2018 13:48:00 +0300 Subject: [PATCH] refactor: apply insets to wrap layout --- .../ui/layouts/wrap-layout/wrap-layout.ios.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tns-core-modules/ui/layouts/wrap-layout/wrap-layout.ios.ts b/tns-core-modules/ui/layouts/wrap-layout/wrap-layout.ios.ts index 87576f6d0..2639d57ee 100644 --- a/tns-core-modules/ui/layouts/wrap-layout/wrap-layout.ios.ts +++ b/tns-core-modules/ui/layouts/wrap-layout/wrap-layout.ios.ts @@ -119,14 +119,14 @@ export class WrapLayout extends WrapLayoutBase { this.setMeasuredDimension(widthAndState, heightAndState); } - public onLayout(left: number, top: number, right: number, bottom: number): void { + public onLayout(left: number, top: number, right: number, bottom: number, insets: {left, top, right, bottom}): void { super.onLayout(left, top, right, bottom); const isVertical = this.orientation === "vertical"; - const paddingLeft = this.effectiveBorderLeftWidth + this.effectivePaddingLeft; - const paddingTop = this.effectiveBorderTopWidth + this.effectivePaddingTop; - const paddingRight = this.effectiveBorderRightWidth + this.effectivePaddingRight; - const paddingBottom = this.effectiveBorderBottomWidth + this.effectivePaddingBottom; + const paddingLeft = this.effectiveBorderLeftWidth + this.effectivePaddingLeft + insets.left; + const paddingTop = this.effectiveBorderTopWidth + this.effectivePaddingTop + insets.top; + const paddingRight = this.effectiveBorderRightWidth + this.effectivePaddingRight + insets.right; + const paddingBottom = this.effectiveBorderBottomWidth + this.effectivePaddingBottom + insets.bottom; let childLeft = paddingLeft; let childTop = paddingTop;