diff options
author | Jeff Brown <jeffbrown@google.com> | 2014-02-11 14:28:48 -0800 |
---|---|---|
committer | Jeff Brown <jeffbrown@google.com> | 2014-02-11 14:43:19 -0800 |
commit | ed4d28dd70448b13eb74a3166ec8d1c1a530e2d4 (patch) | |
tree | 14c881e204f113307a474f613ea41f02e2ec37cc /libs/input | |
parent | 0f0ccf07bad594b618f4fcce9a8f79a5bc188bb3 (diff) | |
download | frameworks_native-ed4d28dd70448b13eb74a3166ec8d1c1a530e2d4.zip frameworks_native-ed4d28dd70448b13eb74a3166ec8d1c1a530e2d4.tar.gz frameworks_native-ed4d28dd70448b13eb74a3166ec8d1c1a530e2d4.tar.bz2 |
Add method to apply offset to PointerCoords. (DO NOT MERGE)
Change-Id: I3dc2ba22b026e5b8e1c3d90f7366ec09a59ce6b6
Diffstat (limited to 'libs/input')
-rw-r--r-- | libs/input/Input.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libs/input/Input.cpp b/libs/input/Input.cpp index 6f53996..ccbf52b 100644 --- a/libs/input/Input.cpp +++ b/libs/input/Input.cpp @@ -213,6 +213,11 @@ void PointerCoords::scale(float scaleFactor) { scaleAxisValue(*this, AMOTION_EVENT_AXIS_TOOL_MINOR, scaleFactor); } +void PointerCoords::applyOffset(float xOffset, float yOffset) { + setAxisValue(AMOTION_EVENT_AXIS_X, getX() + xOffset); + setAxisValue(AMOTION_EVENT_AXIS_Y, getY() + yOffset); +} + #ifdef HAVE_ANDROID_OS status_t PointerCoords::readFromParcel(Parcel* parcel) { bits = parcel->readInt64(); |