Browse Source

Fix non-virtualizing stack layout alignment.

We need to return the max of the bounds and the constraint, otherwise horizontal/vertical alignment doesnt work correctly.
pull/4091/head
Steven Kirk 6 years ago
parent
commit
ff38cf7609
  1. 4
      src/Avalonia.Layout/NonVirtualizingStackLayout.cs

4
src/Avalonia.Layout/NonVirtualizingStackLayout.cs

@ -112,7 +112,9 @@ namespace Avalonia.Layout
u = (isVertical ? bounds.Bottom : bounds.Right) + spacing;
}
return new Size(bounds.Right, bounds.Bottom);
return new Size(
Math.Max(finalSize.Width, bounds.Width),
Math.Max(finalSize.Height, bounds.Height));
}
private static Rect LayoutVertical(ILayoutable element, double y, Size constraint)

Loading…
Cancel
Save