Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit add8a4a9 authored by Prabir Pradhan's avatar Prabir Pradhan
Browse files

MotionEvent: Get offsets in raw coordinate space

MotionEvents store the underlying axis values in the coordinate space of
the physical display, or "untransformed" space. The MotionEvent's
mRawTransform takes those coordinates into the coordinate space of the
logical display, or "raw" coordinates. The MotionEvent's mTransform
takes those coordinates into the window/View's local coordinates.

Previously, getting the motion event offset would return the offset with
respect to the origin of the "untransformed" space. This is of little
value to callers, since they are expecting the offset in "raw"
coordinates, which is the offset with respect to the logical display's
origin.

To calculate the raw offset, we calculate where the raw point (0, 0)
would map to in untransformed coordinates by applying the inverse raw
transform, and then apply the window transform.

Bug: 249340921
Test: atest libinput_tests
Test: atest inputflinger_tests
Change-Id: Iadbdde4dd45b5527b73be863b198b4c9a9e713cc
parent 9180f87b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment