Skip to content

Commit

Permalink
offset using scaled rects
Browse files Browse the repository at this point in the history
  • Loading branch information
SeraphimaZykova committed Oct 7, 2020
1 parent 2e0d39f commit ffac0ae
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,11 @@ public void Add(WorkAreaData workArea)
public void SetActiveMonitor(int monitor)
{
var workArea = Monitors[monitor];
var screen = workArea.WorkAreaScreen.WorkingArea;
Offset = new Point(workArea.ConvertDpi(screen.X - WholeWorkArea.X), workArea.ConvertDpi(screen.Y - WholeWorkArea.Y));
var screen = workArea.WorkAreaRectScaled;

double xDiff = screen.X - WholeWorkAreaScaled.X;
double yDiff = screen.Y - WholeWorkAreaScaled.Y;
Offset = new Point(xDiff, yDiff);
}

public static Screen GetScreen(int monitor)
Expand Down

0 comments on commit ffac0ae

Please sign in to comment.