From 2ad46a8f18c9b64bfab4b963da09c6367dd0ecca Mon Sep 17 00:00:00 2001 From: YeongJong Lee Date: Wed, 15 Jul 2020 14:29:36 +0900 Subject: [PATCH] [NUI] respect GridLayout child margin (#1825) GridLayout child margin was ignored... --- src/Tizen.NUI/src/internal/Layouting/GridLocations.cs | 4 ++-- src/Tizen.NUI/src/public/Layouting/GridLayout.cs | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Tizen.NUI/src/internal/Layouting/GridLocations.cs b/src/Tizen.NUI/src/internal/Layouting/GridLocations.cs index 2a08c1b..1809887 100755 --- a/src/Tizen.NUI/src/internal/Layouting/GridLocations.cs +++ b/src/Tizen.NUI/src/internal/Layouting/GridLocations.cs @@ -258,8 +258,8 @@ namespace Tizen.NUI MeasureChildWithMargins(item, widthMeasureSpec, new LayoutLength(0), heightMeasureSpec, new LayoutLength(0)); gridChildren[i] = new GridChild(item, - new Node(column, columnSpan, item.MeasuredWidth.Size.AsDecimal(), horizontalStretch), - new Node(row, rowSpan, item.MeasuredHeight.Size.AsDecimal(), verticalStretch)); + new Node(column, columnSpan, item.MeasuredWidth.Size.AsDecimal() + item.Owner.Margin.Start + item.Owner.Margin.End, horizontalStretch), + new Node(row, rowSpan, item.MeasuredHeight.Size.AsDecimal() + item.Owner.Margin.Top + item.Owner.Margin.Bottom, verticalStretch)); } } diff --git a/src/Tizen.NUI/src/public/Layouting/GridLayout.cs b/src/Tizen.NUI/src/public/Layouting/GridLayout.cs index e78dd0b..228f032 100755 --- a/src/Tizen.NUI/src/public/Layouting/GridLayout.cs +++ b/src/Tizen.NUI/src/public/Layouting/GridLayout.cs @@ -399,10 +399,10 @@ namespace Tizen.NUI int row = child.Row.Start; int columnEnd = child.Column.End; int rowEnd = child.Row.End; - float l = hLocations[column] + Padding.Start; - float t = vLocations[row] + Padding.Top; - float width = hLocations[columnEnd] - hLocations[column] - ColumnSpacing; - float height = vLocations[rowEnd] - vLocations[row] - RowSpacing; + float l = hLocations[column] + Padding.Start + view.Margin.Start; + float t = vLocations[row] + Padding.Top + view.Margin.Top; + float width = hLocations[columnEnd] - hLocations[column] - ColumnSpacing - view.Margin.Start - view.Margin.End; + float height = vLocations[rowEnd] - vLocations[row] - RowSpacing - view.Margin.Top - view.Margin.Bottom; if (!child.Column.Stretch.HasFlag(StretchFlags.Fill)) { -- 2.7.4