mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-22 13:37:22 +00:00
[client] spice: use modf in cursorToInt
for fractional tracking
This commit is contained in:
parent
78bd41716a
commit
8365419262
@ -874,12 +874,13 @@ static void cursorToInt(double ex, double ey, int *x, int *y)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* convert to int accumulating the fractional error */
|
/* convert to int accumulating the fractional error */
|
||||||
g_cursor.acc.x += ex;
|
ex += g_cursor.acc.x;
|
||||||
g_cursor.acc.y += ey;
|
ey += g_cursor.acc.y;
|
||||||
*x = floor(g_cursor.acc.x);
|
g_cursor.acc.x = modf(ex, &ex);
|
||||||
*y = floor(g_cursor.acc.y);
|
g_cursor.acc.y = modf(ey, &ey);
|
||||||
g_cursor.acc.x -= *x;
|
|
||||||
g_cursor.acc.y -= *y;
|
*x = (int)ex;
|
||||||
|
*y = (int)ey;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void handleMouseGrabbed(double ex, double ey)
|
static void handleMouseGrabbed(double ex, double ey)
|
||||||
|
Loading…
Reference in New Issue
Block a user