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 rookiejava committed Feb 4, 2022
1 parent 0a393b3 commit 68d2c62
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 68d2c62

Please sign in to comment.