瀏覽代碼

[Popup] Use anchor and gravity to get the correct positioning under the mouse.

Dan Walmsley 6 年之前
父節點
當前提交
69b7bc2041
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      src/Avalonia.Controls/Primitives/PopupPositioning/IPopupPositioner.cs

+ 2 - 2
src/Avalonia.Controls/Primitives/PopupPositioning/IPopupPositioner.cs

@@ -305,8 +305,8 @@ namespace Avalonia.Controls.Primitives.PopupPositioning
             positionerParameters.ConstraintAdjustment = PopupPositionerConstraintAdjustment.All;
             if (placement == PlacementMode.Pointer)
             {
-                positionerParameters.AnchorRectangle = new Rect(pointer, new Size(0, 0));
-                positionerParameters.Anchor = PopupPositioningEdge.BottomRight;
+                positionerParameters.AnchorRectangle = new Rect(pointer, new Size(1, 1));
+                positionerParameters.Anchor = PopupPositioningEdge.TopLeft;
                 positionerParameters.Gravity = PopupPositioningEdge.BottomRight;
             }
             else