From f80a13b87ba309417e3a0d985614a3ffe540646e Mon Sep 17 00:00:00 2001 From: Dan Walmsley Date: Sat, 17 Nov 2018 12:41:01 +0000 Subject: [PATCH] fix SnapInsideScreenEdges so that it obeys screen scaling. --- src/Avalonia.Controls/Primitives/PopupRoot.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Avalonia.Controls/Primitives/PopupRoot.cs b/src/Avalonia.Controls/Primitives/PopupRoot.cs index fdec9febd3..286f7df3b9 100644 --- a/src/Avalonia.Controls/Primitives/PopupRoot.cs +++ b/src/Avalonia.Controls/Primitives/PopupRoot.cs @@ -84,8 +84,10 @@ namespace Avalonia.Controls.Primitives if (screen != null) { - var screenX = Position.X + Bounds.Width - screen.Bounds.X; - var screenY = Position.Y + Bounds.Height - screen.Bounds.Y; + var scaling = VisualRoot.RenderScaling; + + var screenX = Position.X + (Bounds.Width * scaling) - screen.Bounds.X; + var screenY = Position.Y + (Bounds.Height * scaling) - screen.Bounds.Y; if (screenX > screen.Bounds.Width) {