Skip to content

Commit

Permalink
fix spacing
Browse files Browse the repository at this point in the history
  • Loading branch information
Poker-sang committed Dec 3, 2024
1 parent 88e1946 commit 30bc857
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/Primitives/src/StaggeredLayout/StaggeredLayout.cs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ protected override Size MeasureOverride(VirtualizingLayoutContext context, Size
if (ItemsStretch is StaggeredLayoutItemsStretch.None)
{
columnWidth = double.IsNaN(DesiredColumnWidth) ? availableWidth : Math.Min(DesiredColumnWidth, availableWidth);
numColumns = Math.Max(1, (int)Math.Floor(availableWidth / state.ColumnWidth));
numColumns = Math.Max(1, (int)Math.Floor(availableWidth / (columnWidth + ColumnSpacing)));
}
else
{
Expand All @@ -176,7 +176,7 @@ protected override Size MeasureOverride(VirtualizingLayoutContext context, Size
{
// 0.0001 is to prevent floating point errors
var tempAvailableWidth = availableWidth + ColumnSpacing - 0.0001;
numColumns = (int)Math.Floor(tempAvailableWidth / DesiredColumnWidth);
numColumns = (int)Math.Floor(tempAvailableWidth / (DesiredColumnWidth + ColumnSpacing));
columnWidth = tempAvailableWidth / numColumns - ColumnSpacing;
}
}
Expand Down

0 comments on commit 30bc857

Please sign in to comment.