[client] core: clamp the local position to the dstRect correctly

When running in a mode that is letterboxed the dstRect origin is not 0x0
This commit is contained in:
Geoffrey McRae 2021-05-05 23:18:13 +10:00
parent 9dd11b5e04
commit bdfb18299d

View File

@ -322,8 +322,10 @@ void core_handleGuestMouseUpdate(void)
util_guestCurToLocal(&localPos); util_guestCurToLocal(&localPos);
g_state.ds->guestPointerUpdated( g_state.ds->guestPointerUpdated(
g_cursor.guest.x, g_cursor.guest.y, g_cursor.guest.x, g_cursor.guest.y,
util_clamp(localPos.x, 0.0, g_state.dstRect.w), util_clamp(localPos.x, g_state.dstRect.x,
util_clamp(localPos.y, 0.0, g_state.dstRect.h) g_state.dstRect.x + g_state.dstRect.w),
util_clamp(localPos.y, g_state.dstRect.y,
g_state.dstRect.y + g_state.dstRect.h)
); );
} }