Skip to content

Commit

Permalink
Fix Layout margin issue (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
myroot authored and GitHub Enterprise committed Jul 8, 2021
1 parent 1f38e6a commit 3c6ed6e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Core/src/Handlers/Layout/LayoutHandler.Tizen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,20 @@ protected void OnLayoutUpdated(object? sender, LayoutEventArgs e)
{
VirtualView.InvalidateMeasure();
VirtualView.InvalidateArrange();
VirtualView.Measure(nativeGeometry.Width, nativeGeometry.Height);

if (!_layoutUpdatedRegistered)
{
nativeGeometry.X = VirtualView.Frame.X;
nativeGeometry.Y = VirtualView.Frame.Y;
}

// revoke margin area, we need to assign area including margin
nativeGeometry.Width += VirtualView.Margin.HorizontalThickness;
nativeGeometry.Height += VirtualView.Margin.VerticalThickness;
nativeGeometry.X -= VirtualView.Margin.Left;
nativeGeometry.Y -= VirtualView.Margin.Top;

VirtualView.Measure(nativeGeometry.Width, nativeGeometry.Height);
VirtualView.Arrange(nativeGeometry);
}
}
Expand Down

0 comments on commit 3c6ed6e

Please sign in to comment.