Skip to content

Commit 767f3b5

Browse files
committed
update logic regarding 0-width items
1 parent 63c9eba commit 767f3b5

File tree

1 file changed

+2
-2
lines changed
  • Microsoft.Toolkit.Uwp.UI.Controls.Primitives/WrapPanel

1 file changed

+2
-2
lines changed

Microsoft.Toolkit.Uwp.UI.Controls.Primitives/WrapPanel/WrapPanel.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,12 +209,12 @@ private Size UpdateRows(Size availableSize)
209209
var finalMeasure = new UvMeasure(Orientation, width: 0.0, height: 0.0);
210210
void Arrange(UIElement child, bool isLast = false)
211211
{
212-
var desiredMeasure = new UvMeasure(Orientation, child.DesiredSize);
213-
if (desiredMeasure.U == 0)
212+
if (child.Visibility == Visibility.Collapsed)
214213
{
215214
return; // if an item is collapsed, avoid adding the spacing
216215
}
217216

217+
var desiredMeasure = new UvMeasure(Orientation, child.DesiredSize);
218218
if ((desiredMeasure.U + position.U + paddingEnd.U) > parentMeasure.U)
219219
{
220220
// next row!

0 commit comments

Comments
 (0)