Browse Source

If the children are in the same column/row, the Grid will not incorrectly aggregate their widths/heights.

Instead, it will calculate the Max width/height.
pull/1517/head
walterlv 8 years ago
parent
commit
e58a0641bf
  1. 5
      src/Avalonia.Controls/Utils/GridLayout.cs

5
src/Avalonia.Controls/Utils/GridLayout.cs

@ -378,9 +378,10 @@ namespace Avalonia.Controls.Utils
// 需要返回所有标记为 * 的方格的累加和的最小值。
// Before we determine the behavior of this method, we just aggregate the one-span * columns.
return _additionalConventions
var lookup = _additionalConventions
.Where(x => x.Span == 1 && conventions[x.Index].Length.IsStar)
.Sum(x => x.Min);
.ToLookup(x => x.Index);
return lookup.Select(group => group.Max(x => x.Min)).Sum();
}
/// <summary>

Loading…
Cancel
Save