Added helper functions in Transform and PointerCoords
1. Getter for each element in the Transform matrix.
2. Setter for Transform using a nine element array.
3. New multiply in Transform to multiply all elements by a single
value
4. transform function in PointerCoords to apply the transform to x and y
coordinate
Test: Builds
Bug: 158476194
Change-Id: Iafe07813c6ce8127875b06e6e6e11554d1862f6f
diff --git a/libs/input/Input.cpp b/libs/input/Input.cpp
index 31aa685..2ac079e 100644
--- a/libs/input/Input.cpp
+++ b/libs/input/Input.cpp
@@ -301,6 +301,11 @@
}
}
+void PointerCoords::transform(const ui::Transform& transform) {
+ vec2 newCoords = transform.transform(getX(), getY());
+ setAxisValue(AMOTION_EVENT_AXIS_X, newCoords.x);
+ setAxisValue(AMOTION_EVENT_AXIS_Y, newCoords.y);
+}
// --- PointerProperties ---