这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ bool IOverlayWindowHost.HitTestScreen(Point dragPoint)

bool HitTest(Point dragPoint)
{
if (dragPoint == default(Point))
return false;
var detectionRect = new Rect(this.PointToScreenDPIWithoutFlowDirection(new Point()), this.TransformActualSizeToAncestor());
return detectionRect.Contains(dragPoint);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,8 @@ bool IOverlayWindowHost.HitTestScreen(Point dragPoint)

bool HitTest(Point dragPoint)
{
if (dragPoint == default(Point))
return false;
var detectionRect = new Rect(this.PointToScreenDPIWithoutFlowDirection(new Point()), this.TransformActualSizeToAncestor());
return detectionRect.Contains(dragPoint);
}
Expand Down
7 changes: 5 additions & 2 deletions source/Components/AvalonDock/Controls/TransformExtentions.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/************************************************************************
/************************************************************************
AvalonDock

Copyright (C) 2007-2013 Xceed Software Inc.
Expand Down Expand Up @@ -59,7 +59,10 @@ public static Rect GetScreenArea(this FrameworkElement element)

public static Point TransformToDeviceDPI(this Visual visual, Point pt)
{
Matrix m = PresentationSource.FromVisual(visual).CompositionTarget.TransformToDevice;
var compositionTarget = PresentationSource.FromVisual(visual).CompositionTarget;
if (compositionTarget == null)
return default;
Matrix m = compositionTarget.TransformToDevice;
return new Point(pt.X / m.M11, pt.Y / m.M22);
}

Expand Down