summaryrefslogtreecommitdiff
path: root/libs/ultrahdr/jpegencoderhelper.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 20:53:39 +0000
commit00e029d8cfd1e5487d8c8997ec852ffd54252a57 (patch)
treee8b10f40dd1400a8e166c00dc65d436f890bbae4 /libs/ultrahdr/jpegencoderhelper.cpp
parent2c1f96e0d825463dc1e420982d31d77bd442d9e7 (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
Diffstat (limited to 'libs/ultrahdr/jpegencoderhelper.cpp')
0 files changed, 0 insertions, 0 deletions