Skip to content

Commit 0836390

Browse files
committed
fix: fixed #996
1 parent 55e35e6 commit 0836390

File tree

1 file changed

+4
-1
lines changed
  • src/Shared/HandyControl_Shared/Controls/Panel/Grid

1 file changed

+4
-1
lines changed

src/Shared/HandyControl_Shared/Controls/Panel/Grid/Row.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System.Linq;
1+
using System;
2+
using System.Linq;
23
using System.Windows;
34
using System.Windows.Controls;
45
using HandyControl.Data;
@@ -67,6 +68,8 @@ protected override Size ArrangeOverride(Size finalSize)
6768
var totalCellCount = 0;
6869
var gutterHalf = Gutter / 2;
6970
var itemWidth = (finalSize.Width - _totalAutoWidth + Gutter) / ColLayout.ColMaxCellCount;
71+
itemWidth = Math.Max(0, itemWidth);
72+
7073
var childBounds = new Rect(-gutterHalf, -gutterHalf, 0, _maxChildDesiredHeight);
7174
_layoutStatus = ColLayout.GetLayoutStatus(finalSize.Width);
7275

0 commit comments

Comments
 (0)