Browse Source

Use screen bounds Bottom instead of Height.

Secondard screens on Windows can have a Y offset (i.e. `bounds.Y != 0`) if they're offset vertically from the primary screen, and when this was the case the popup wasn't getting properly constrained as the bottom is not equal to the height.

Fixes #4726
pull/4728/head
Steven Kirk 6 years ago
parent
commit
1430bf86e3
  1. 2
      src/Avalonia.Controls/Primitives/PopupPositioning/ManagedPopupPositioner.cs

2
src/Avalonia.Controls/Primitives/PopupPositioning/ManagedPopupPositioner.cs

@ -221,7 +221,7 @@ namespace Avalonia.Controls.Primitives.PopupPositioning
if (!FitsInBounds(unconstrainedRect, PopupAnchor.Bottom))
{
unconstrainedRect = unconstrainedRect.WithHeight(bounds.Height - unconstrainedRect.Y);
unconstrainedRect = unconstrainedRect.WithHeight(bounds.Bottom - unconstrainedRect.Y);
}
if (IsValid(unconstrainedRect))

Loading…
Cancel
Save