Commit 2dc77dbb authored by Jesus's avatar Jesus Committed by Martin Finkel

WPF: Fix Foreground location when using HiDPI displays

(cherry picked from commit 2f85d1ded4388fb3270ed94f319e96f8e39a6120)
parent 332cf8d0
...@@ -38,7 +38,7 @@ namespace LibVLCSharp.WPF ...@@ -38,7 +38,7 @@ namespace LibVLCSharp.WPF
void Background_Unloaded(object sender, RoutedEventArgs e) void Background_Unloaded(object sender, RoutedEventArgs e)
{ {
_wndhost.Closing -= Wndhost_Closing; _wndhost.Closing -= Wndhost_Closing;
_wndhost.SizeChanged -= Wndhost_SizeChanged; _bckgnd.SizeChanged -= Wndhost_SizeChanged;
_wndhost.LocationChanged -= Wndhost_LocationChanged; _wndhost.LocationChanged -= Wndhost_LocationChanged;
Hide(); Hide();
...@@ -52,7 +52,7 @@ namespace LibVLCSharp.WPF ...@@ -52,7 +52,7 @@ namespace LibVLCSharp.WPF
Owner = _wndhost; Owner = _wndhost;
_wndhost.Closing += Wndhost_Closing; _wndhost.Closing += Wndhost_Closing;
_wndhost.SizeChanged += Wndhost_SizeChanged; _bckgnd.SizeChanged += Wndhost_SizeChanged;
_wndhost.LocationChanged += Wndhost_LocationChanged; _wndhost.LocationChanged += Wndhost_LocationChanged;
try try
...@@ -62,7 +62,7 @@ namespace LibVLCSharp.WPF ...@@ -62,7 +62,7 @@ namespace LibVLCSharp.WPF
var targetPoints = source.CompositionTarget.TransformFromDevice.Transform(locationFromScreen); var targetPoints = source.CompositionTarget.TransformFromDevice.Transform(locationFromScreen);
Left = targetPoints.X; Left = targetPoints.X;
Top = targetPoints.Y; Top = targetPoints.Y;
var size = _bckgnd.PointToScreen(new Point(_bckgnd.ActualWidth, _bckgnd.ActualHeight)) - _bckgnd.PointToScreen(_zeroPoint); var size = new Point(_bckgnd.ActualWidth, _bckgnd.ActualHeight);
Height = size.Y; Height = size.Y;
Width = size.X; Width = size.X;
Show(); Show();
...@@ -91,7 +91,7 @@ namespace LibVLCSharp.WPF ...@@ -91,7 +91,7 @@ namespace LibVLCSharp.WPF
var targetPoints = source.CompositionTarget.TransformFromDevice.Transform(locationFromScreen); var targetPoints = source.CompositionTarget.TransformFromDevice.Transform(locationFromScreen);
Left = targetPoints.X; Left = targetPoints.X;
Top = targetPoints.Y; Top = targetPoints.Y;
var size = _bckgnd.PointToScreen(new Point(_bckgnd.ActualWidth, _bckgnd.ActualHeight)) - _bckgnd.PointToScreen(_zeroPoint); var size = new Point(_bckgnd.ActualWidth, _bckgnd.ActualHeight);
Height = size.Y; Height = size.Y;
Width = size.X; Width = size.X;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment