From bdfb18299d77c8a955ff71da600866e7647c8f88 Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Wed, 5 May 2021 23:18:13 +1000 Subject: [PATCH] [client] core: clamp the local position to the dstRect correctly When running in a mode that is letterboxed the dstRect origin is not 0x0 --- client/src/core.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/client/src/core.c b/client/src/core.c index cc7b5376..1c03d1ef 100644 --- a/client/src/core.c +++ b/client/src/core.c @@ -322,8 +322,10 @@ void core_handleGuestMouseUpdate(void) util_guestCurToLocal(&localPos); g_state.ds->guestPointerUpdated( g_cursor.guest.x, g_cursor.guest.y, - util_clamp(localPos.x, 0.0, g_state.dstRect.w), - util_clamp(localPos.y, 0.0, g_state.dstRect.h) + util_clamp(localPos.x, g_state.dstRect.x, + g_state.dstRect.x + g_state.dstRect.w), + util_clamp(localPos.y, g_state.dstRect.y, + g_state.dstRect.y + g_state.dstRect.h) ); }