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));
}
}
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))
{