mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-08-04 01:34:13 +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:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user