From ed4d28dd70448b13eb74a3166ec8d1c1a530e2d4 Mon Sep 17 00:00:00 2001 From: Jeff Brown Date: Tue, 11 Feb 2014 14:28:48 -0800 Subject: Add method to apply offset to PointerCoords. (DO NOT MERGE) Change-Id: I3dc2ba22b026e5b8e1c3d90f7366ec09a59ce6b6 --- libs/input/Input.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'libs/input') 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(); -- cgit v1.1