mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-10 08:38:20 +00:00
[client] spice: fix rounding issue causing entry->exit in the same event
This fixes an issue where the warp to center could break as the user moves their cursor slowly over one of the bottom or right edges of the screen while it's letterboxed.
This commit is contained in:
parent
c2ad9666bb
commit
e70f585cfc
@ -889,8 +889,10 @@ static void handleMouseMoveEvent(int ex, int ey)
|
||||
g_cursor.warpState = WARP_STATE_ON;
|
||||
|
||||
/* convert guest to local and calculate the delta */
|
||||
const int lx = ((g_cursor.guest.x + g_cursor.guest.hx) / g_cursor.scaleX) + g_state.dstRect.x;
|
||||
const int ly = ((g_cursor.guest.y + g_cursor.guest.hy) / g_cursor.scaleY) + g_state.dstRect.y;
|
||||
const int lx = (int)round(((g_cursor.guest.x + g_cursor.guest.hx) /
|
||||
g_cursor.scaleX)) + g_state.dstRect.x;
|
||||
const int ly = (int)round(((g_cursor.guest.y + g_cursor.guest.hy) /
|
||||
g_cursor.scaleY)) + g_state.dstRect.y;
|
||||
delta.x = ex - lx;
|
||||
delta.y = ey - ly;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user