Skip to content

Commit 813a61a

Browse files
committed
Update BreadcrumbBarLayout.cs
1 parent e1f8a98 commit 813a61a

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

src/Files.App.Controls/BreadcrumbBar/BreadcrumbBarLayout.cs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,21 +33,14 @@ protected override Size MeasureOverride(NonVirtualizingLayoutContext context, Si
3333
var accumulatedSize = new Size(0, 0);
3434
_availableSize = availableSize;
3535

36-
// Ensure we have a minimum size to prevent DivideByZeroException in WinUI
37-
// When availableSize has zero dimensions, provide a minimal positive size for measurement
38-
var measureSize = new Size(
39-
Math.Max(availableSize.Width, 1.0),
40-
Math.Max(availableSize.Height, 1.0)
41-
);
42-
4336
var indexAfterEllipsis = GetFirstIndexToRender(context);
4437

4538
// Go through all items and measure them
4639
for (int index = 0; index < context.Children.Count; index++)
4740
{
4841
if (context.Children[index] is BreadcrumbBarItem breadcrumbItem)
4942
{
50-
breadcrumbItem.Measure(measureSize);
43+
breadcrumbItem.Measure(availableSize);
5144
accumulatedSize.Width += index < indexAfterEllipsis ? 0 : breadcrumbItem.DesiredSize.Width;
5245
accumulatedSize.Height = Math.Max(accumulatedSize.Height, breadcrumbItem.DesiredSize.Height);
5346
}
@@ -122,4 +115,4 @@ private int GetFirstIndexToRender(NonVirtualizingLayoutContext context)
122115
return 0;
123116
}
124117
}
125-
}
118+
}

0 commit comments

Comments
 (0)