From c85fcbdfb172c8812768ab7af7117c23c89d2daf Mon Sep 17 00:00:00 2001 From: ephphatha Date: Fri, 1 Sep 2023 20:09:36 +1000 Subject: [PATCH] fix cursor alignment following gamepad movement in stash align the cursor to the middle of the cell/region when moving through the stash to match the way we simulate mouse movement for inventory cells --- Source/controls/plrctrls.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/controls/plrctrls.cpp b/Source/controls/plrctrls.cpp index d10729598..947398b71 100644 --- a/Source/controls/plrctrls.cpp +++ b/Source/controls/plrctrls.cpp @@ -1167,9 +1167,9 @@ void StashMove(AxisDirection dir) if (ActiveStashSlot != InvalidStashPoint) { Point mousePos = GetStashSlotCoord(ActiveStashSlot); - if (pcurs == CURSOR_HAND) { - mousePos += Displacement { INV_SLOT_HALF_SIZE_PX, INV_SLOT_HALF_SIZE_PX }; - } + // Stash coordinates are all the top left of the cell, so we need to shift the mouse to the center of the held item + // or the center of the cell if we have a hand cursor (itemSize will be 1x1 here so we can use the same calculation) + mousePos += Displacement { itemSize.width * INV_SLOT_HALF_SIZE_PX, itemSize.height * INV_SLOT_HALF_SIZE_PX }; SetCursorPos(mousePos); return; }