Skip to content

Commit 74b3f37

Browse files
authored
Fix PopupBox transforming to device coordinates with global system DPI (#3641)
PopupBox correctly transforms from device coordinates using the PresentationSource transform matrix, but then uses the global system DPI to transform back to device coordinates. This causes placement issues on systems with multiple DPI/scaling settings.
1 parent 958dde5 commit 74b3f37

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/MaterialDesignThemes.Wpf/PopupBox.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -617,8 +617,8 @@ private CustomPopupPlacement[] GetPopupPlacement(Size popupSize, Size targetSize
617617
throw new ArgumentOutOfRangeException();
618618
}
619619

620-
double xTransformed = DpiHelper.TransformToDeviceX(x);
621-
double yTransformed = DpiHelper.TransformToDeviceY(y);
620+
double xTransformed = DpiHelper.TransformToDeviceX(this, x);
621+
double yTransformed = DpiHelper.TransformToDeviceY(this, y);
622622

623623
_popupPointFromLastRequest = new Point(xTransformed, yTransformed);
624624
return new[] { new CustomPopupPlacement(_popupPointFromLastRequest, PopupPrimaryAxis.Horizontal) };

0 commit comments

Comments
 (0)