Skip to content

Commit

Permalink
Fix scaling
Browse files Browse the repository at this point in the history
  • Loading branch information
R-N committed Mar 23, 2022
1 parent b7987f2 commit 3e452e1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions PiP-Tool/ViewModels/PiPModeViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -281,11 +281,12 @@ private void UpdateDwmThumbnail()
{
if (_thumbHandle == IntPtr.Zero)
return;

var dest = new NativeStructs.Rect(0, _heightOffset, (int)(_width * _dpiX), (int)(_height * _dpiY));
var rcSource = _selectedWindow.SelectedRegion;
rcSource = new NativeStructs.Rect(rcSource);
rcSource.Top = rcSource.Top + _heightOffset;
var ratio = (rcSource.Bottom - rcSource.Top) / (float)_height / _dpiY;
rcSource.Top = rcSource.Top + (int)(_heightOffset * ratio);
var props = new NativeStructs.DwmThumbnailProperties
{
fVisible = true,
Expand Down

0 comments on commit 3e452e1

Please sign in to comment.