Browse Source

Merge pull request #7832 from AvaloniaUI/fixes/7815-overlaylayer-measure

Measure overlay layer children to constraint.
pull/7853/head
Dan Walmsley 5 years ago
committed by GitHub
parent
commit
e013e4c044
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      src/Avalonia.Controls/Primitives/OverlayLayer.cs

9
src/Avalonia.Controls/Primitives/OverlayLayer.cs

@ -23,7 +23,14 @@ namespace Avalonia.Controls.Primitives
}
public bool HitTest(Point point) => Children.HitTestCustom(point);
protected override Size MeasureOverride(Size availableSize)
{
foreach (Control child in Children)
child.Measure(availableSize);
return availableSize;
}
protected override Size ArrangeOverride(Size finalSize)
{
// We are saving it here since child controls might need to know the entire size of the overlay

Loading…
Cancel
Save