Browse Source
Merge pull request #2416 from AvaloniaUI/fixes/context-menu-snap-inside-edges
fix popup root snap inside screen edges.
release/0.8.0
danwalmsley
8 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
2 additions and
2 deletions
-
src/Avalonia.Controls/Primitives/PopupRoot.cs
|
|
|
@ -91,12 +91,12 @@ namespace Avalonia.Controls.Primitives |
|
|
|
|
|
|
|
if (screenX > screen.Bounds.Width) |
|
|
|
{ |
|
|
|
Position = Position.WithX(Position.X - screenX - bounds.Width); |
|
|
|
Position = Position.WithX(Position.X - (screenX - screen.Bounds.Width)); |
|
|
|
} |
|
|
|
|
|
|
|
if (screenY > screen.Bounds.Height) |
|
|
|
{ |
|
|
|
Position = Position.WithY(Position.Y - screenY - bounds.Height); |
|
|
|
Position = Position.WithY(Position.Y - (screenY - screen.Bounds.Height)); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|