Skip to content

Commit

Permalink
Merge pull request #7832 from AvaloniaUI/fixes/7815-overlaylayer-measure
Browse files Browse the repository at this point in the history
Measure overlay layer children to constraint.
  • Loading branch information
danwalmsley committed Mar 22, 2022
1 parent 77eb149 commit 582389e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Avalonia.Controls/Primitives/OverlayLayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,14 @@ public static OverlayLayer GetOverlayLayer(IVisual visual)
}

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
Expand Down

0 comments on commit 582389e

Please sign in to comment.