diff options
author | Dianne Hackborn <hackbod@google.com> | 2011-05-09 21:19:26 -0700 |
---|---|---|
committer | Dianne Hackborn <hackbod@google.com> | 2011-05-09 21:19:26 -0700 |
commit | e7d25b74b0f5c8ad32225c7a3e98a0d1717eb7c7 (patch) | |
tree | 652330584e9291210cd781f118afeb8625ef92f3 /services/input | |
parent | 0c6cbf410a642f6e9cea7cca0a6e53a4a3cdd324 (diff) | |
download | frameworks_base-e7d25b74b0f5c8ad32225c7a3e98a0d1717eb7c7.zip frameworks_base-e7d25b74b0f5c8ad32225c7a3e98a0d1717eb7c7.tar.gz frameworks_base-e7d25b74b0f5c8ad32225c7a3e98a0d1717eb7c7.tar.bz2 |
Fix scaling of batched motion events.
Change-Id: I1e070c936f7b2e8f1bb7ebae62b1df0aa6998b82
Diffstat (limited to 'services/input')
-rw-r--r-- | services/input/InputDispatcher.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/services/input/InputDispatcher.cpp b/services/input/InputDispatcher.cpp index f8a5cfb..a94e0e9 100644 --- a/services/input/InputDispatcher.cpp +++ b/services/input/InputDispatcher.cpp @@ -1888,6 +1888,14 @@ void InputDispatcher::startDispatchCycleLocked(nsecs_t currentTime, // Append additional motion samples. MotionSample* nextMotionSample = firstMotionSample->next; for (; nextMotionSample != NULL; nextMotionSample = nextMotionSample->next) { + if ((motionEntry->source & AINPUT_SOURCE_CLASS_POINTER) != 0 && scaleFactor != 1.0f) { + for (size_t i = 0; i < motionEntry->pointerCount; i++) { + scaledCoords[i] = nextMotionSample->pointerCoords[i]; + scaledCoords[i].scale(scaleFactor); + } + } else { + usingCoords = nextMotionSample->pointerCoords; + } status = connection->inputPublisher.appendMotionSample( nextMotionSample->eventTime, usingCoords); if (status == NO_MEMORY) { |