TouchInputMapper: Fix pointer ID in dispatchPointerMouse

I encountered this apparent error while refactoring. I tested cursor
movement with both a mouse and a touchpad with this "fix" in place, and
cannot see a difference in behaviour. I also can't imagine how it
couldn't be an error, given that (if I understand correctly) the pointer
index for a the same pointer ID can change between events.

However, given that I can't work out the circumstances in which this
code is executed, or locate the commit that originally introduced the
error, I've separated this change into its own commit to call attention
to it.

Bug: none
Test: check pointer movement; atest inputflinger_tests
Change-Id: I89d8e10577f99fb8699abbea652a694ff3b7ca20
diff --git a/services/inputflinger/reader/mapper/TouchInputMapper.cpp b/services/inputflinger/reader/mapper/TouchInputMapper.cpp
index 2ebbd37..eaf03f1 100644
--- a/services/inputflinger/reader/mapper/TouchInputMapper.cpp
+++ b/services/inputflinger/reader/mapper/TouchInputMapper.cpp
@@ -3441,7 +3441,7 @@
         uint32_t currentIndex = mCurrentRawState.rawPointerData.idToIndex[id];
         float deltaX = 0, deltaY = 0;
         if (mLastCookedState.mouseIdBits.hasBit(id)) {
-            uint32_t lastIndex = mCurrentRawState.rawPointerData.idToIndex[id];
+            uint32_t lastIndex = mLastRawState.rawPointerData.idToIndex[id];
             deltaX = (mCurrentRawState.rawPointerData.pointers[currentIndex].x -
                       mLastRawState.rawPointerData.pointers[lastIndex].x) *
                     mPointerXMovementScale;