Skip to content

Commit

Permalink
Solve #1
Browse files Browse the repository at this point in the history
  • Loading branch information
lingrottin committed Oct 4, 2023
1 parent becfe3e commit 6104ee4
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions MapTP.App/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -444,13 +444,21 @@ private IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref b
InputX = x.X;
InputY = x.Y;

if (started && (tpsx <= x.X && x.X <= tpex) && (tpsy <= x.Y && x.Y <= tpey))
if (started)
{
try
{
int X, Y;
X = (int)Math.Floor((((decimal)(x.X - tpsx) / tpgx * scgx) + scsx) / ScreenSizeX * 65535);
Y = (int)Math.Floor((((decimal)(x.Y - tpsy) / tpgy * scgy) + scsy) / ScreenSizeY * 65535);
X = (tpsx <= x.X ?
(tpex >= x.X ?
(int)Math.Floor((((decimal)(x.X - tpsx) / tpgx * scgx) + scsx) / ScreenSizeX * 65535)
: (int)Math.Floor((decimal)scex/ScreenSizeX*65535) )
: (int)Math.Floor((decimal)scsx / ScreenSizeX * 65535) );
Y = (tpsy <= x.Y ?
(tpey >= x.Y ?
(int)Math.Floor((((decimal)(x.Y - tpsy) / tpgy * scgy) + scsy) / ScreenSizeY * 65535)
: (int)Math.Floor((decimal)scey / ScreenSizeY * 65535) )
: (int)Math.Floor((decimal)scsy / ScreenSizeY * 65535) );
mouseProcessor.MoveCursor(X, Y);

}
Expand Down

0 comments on commit 6104ee4

Please sign in to comment.