mirror of
https://github.com/gnif/LookingGlass.git
synced 2026-08-09 08:41:31 +00:00
[client] input: round warps past viewport edges
This commit is contained in:
@@ -55,6 +55,11 @@ static bool isInView(void)
|
|||||||
g_cursor.pos.y < g_state.dstRect.y + g_state.dstRect.h;
|
g_cursor.pos.y < g_state.dstRect.y + g_state.dstRect.h;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int exitPos(double pos, int edge)
|
||||||
|
{
|
||||||
|
return pos < edge ? floor(pos) : ceil(pos);
|
||||||
|
}
|
||||||
|
|
||||||
bool core_inputEnabled(void)
|
bool core_inputEnabled(void)
|
||||||
{
|
{
|
||||||
return g_params.useSpiceInput && !g_state.ignoreInput &&
|
return g_params.useSpiceInput && !g_state.ignoreInput &&
|
||||||
@@ -726,8 +731,8 @@ fallback:
|
|||||||
didExit = true;
|
didExit = true;
|
||||||
local.x += move.x;
|
local.x += move.x;
|
||||||
local.y += move.y;
|
local.y += move.y;
|
||||||
const int tx = (local.x <= 0.0) ? floor(local.x) : ceil(local.x);
|
const int tx = exitPos(local.x, g_state.dstRect.x);
|
||||||
const int ty = (local.y <= 0.0) ? floor(local.y) : ceil(local.y);
|
const int ty = exitPos(local.y, g_state.dstRect.y);
|
||||||
|
|
||||||
MTRACE("exit local=%.3f,%.3f move=%.3f,%.3f target=%d,%d "
|
MTRACE("exit local=%.3f,%.3f move=%.3f,%.3f target=%d,%d "
|
||||||
"dst=%d,%d,%d,%d support=%d", local.x - move.x,
|
"dst=%d,%d,%d,%d support=%d", local.x - move.x,
|
||||||
|
|||||||
Reference in New Issue
Block a user