summaryrefslogtreecommitdiff
path: root/libs/gui/LayerState.cpp
diff options
context:
space:
mode:
author Prabir Pradhan <prabirmsp@google.com> 2023-03-09 20:11:09 +0000
committer Prabir Pradhan <prabirmsp@google.com> 2023-03-10 23:01:21 +0000
commit0909dc1c34c40aafbd6d633241e5622dc1cede0b (patch)
tree64e246cd7966ada31284fca3006466e75dd33790 /libs/gui/LayerState.cpp
parent51b7ac6e128050f7966c130e4d5b3cb6f73905d0 (diff)
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 Merged-In: I81062597058361a1218e6873d34b9b0d2fbfad96
Diffstat (limited to 'libs/gui/LayerState.cpp')
0 files changed, 0 insertions, 0 deletions