Skip to content
This repository has been archived by the owner on Jun 10, 2024. It is now read-only.

Commit

Permalink
Fix NavigationBar Drawing error
Browse files Browse the repository at this point in the history
  • Loading branch information
yiszza committed Dec 8, 2023
1 parent 9e6c143 commit 2490101
Showing 1 changed file with 5 additions and 19 deletions.
24 changes: 5 additions & 19 deletions src/Material.Components.Maui/Components/Layouts/AutoFillLayout.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,28 +21,14 @@ public override Size Measure(double widthConstraint, double heightConstraint)
{
this.childrenSizes.Clear();

var maxWidth = 0d;
var maxHeight = 0d;

foreach (var item in layout.Children)
{
var size = item.Measure(widthConstraint, heightConstraint);
maxWidth += size.Width;
maxHeight = Math.Max(maxHeight, size.Height);
this.childrenSizes.Add(size);
}

maxWidth =
widthConstraint != double.PositiveInfinity
? Math.Max(maxWidth, widthConstraint)
: maxWidth;
var childrenWidth = Math.Ceiling(maxWidth / layout.Children.Count);
for (var i = 0; i < this.childrenSizes.Count; i++)
var childrenWidth = Math.Ceiling(widthConstraint / layout.Children.Count);
for (var i = 0; i < layout.Children.Count; i++)
{
this.childrenSizes[i] = new Size(childrenWidth, maxHeight);
this.childrenSizes.Add(new Size(childrenWidth, heightConstraint));
layout.Children[i].Measure(childrenWidth, heightConstraint);
}

return new Size(maxWidth, maxHeight);
return new Size(widthConstraint, heightConstraint);
}

public override Size ArrangeChildren(Rect bounds)
Expand Down

0 comments on commit 2490101

Please sign in to comment.