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

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

MotionEvent: Round coordinates to a precision of 0.001

When tests inject input events at a location on the screen, the
dispatched event is expected to have the same coordinates. However, on
scaled devices, this may not always be the case due to precision losses
incurred through floating point arithmetics. For example, it was
possible for an injected event with a coordinate of 1.0 to end up with
a value of 0.9997.

To combat this issue, we will round transformed axis values that are
leaving a MotionEvent to a precision of 0.001. After this CL, even if
the injection process results in precision losses, they should be
overcome by rounding, assuming injection does not require greater
precision.

This will solve the issue where input injected to an inclusive edge of
the View bounds was not getting dispatched to the View due to precision
losses.

Bug: 264978231
Bug: 260965930
Test: atest libinput_tests
Test: atest inputflinger_tests
Test: atest HoverTest (with screen size override)
Change-Id: I81062597058361a1218e6873d34b9b0d2fbfad96
parent 2c1f96e0
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