Skip to content

Commit

Permalink
fix: #1533
Browse files Browse the repository at this point in the history
  • Loading branch information
NaBian committed Mar 5, 2024
1 parent 90985df commit 6333276
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Shared/HandyControl_Shared/Controls/Panel/Grid/Row.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ protected override Size MeasureOverride(Size constraint)
if (cellCount > 0 && !child.IsFixed)
{
totalCellCount += cellCount;
child.Measure(new Size(cellCount * itemWidth - gutter, constraint.Height));
var availableWidth = Math.Max(0, cellCount * itemWidth - gutter);

child.Measure(new Size(availableWidth, constraint.Height));
_maxChildDesiredHeight = Math.Max(_maxChildDesiredHeight, child.DesiredSize.Height);

if (totalCellCount > ColLayout.ColMaxCellCount)
Expand Down Expand Up @@ -94,7 +96,7 @@ protected override Size ArrangeOverride(Size finalSize)
var cellCount = child.GetLayoutCellCount(_layoutStatus);
totalCellCount += cellCount;

var childWidth = (cellCount > 0 && !child.IsFixed) ? cellCount * itemWidth - gutter : child.DesiredSize.Width;
var childWidth = (cellCount > 0 && !child.IsFixed) ? Math.Max(0, cellCount * itemWidth - gutter) : child.DesiredSize.Width;
childBounds.Width = childWidth;
childBounds.X += child.Offset * itemWidth;

Expand Down

0 comments on commit 6333276

Please sign in to comment.