mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-04-29 10:06:28 +00:00
[client] mouse: don't smooth large cursor jumps (ie, warp to align)
This commit is contained in:
parent
fe835b98d5
commit
2a69a19dbd
@ -895,8 +895,18 @@ static void cursorToInt(double ex, double ey, int *x, int *y)
|
|||||||
if (params.mouseSmoothing && !(g_cursor.grab && params.rawMouse))
|
if (params.mouseSmoothing && !(g_cursor.grab && params.rawMouse))
|
||||||
{
|
{
|
||||||
static struct DoublePoint last = { 0 };
|
static struct DoublePoint last = { 0 };
|
||||||
ex = last.x = (last.x + ex) / 2.0;
|
|
||||||
ey = last.y = (last.y + ey) / 2.0;
|
/* only apply smoothing to small deltas */
|
||||||
|
if (fabs(ex - last.x) < 5.0 && fabs(ey - last.y) < 5.0)
|
||||||
|
{
|
||||||
|
ex = last.x = (last.x + ex) / 2.0;
|
||||||
|
ey = last.y = (last.y + ey) / 2.0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
last.x = ex;
|
||||||
|
last.y = ey;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* convert to int accumulating the fractional error */
|
/* convert to int accumulating the fractional error */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user