diff options
| author | 2011-02-16 15:30:54 -0800 | |
|---|---|---|
| committer | 2011-02-16 15:30:54 -0800 | |
| commit | b5fd7ae4ce28af9217fbd80716466f971bb96d69 (patch) | |
| tree | b168b8e1a34fcc3c45d30e96e7fde5ff9fedc3b6 /services/input/InputReader.cpp | |
| parent | 8c5d38f85e404b1b8643bbbd1d5a36d0bcec7cca (diff) | |
| parent | c3451d4a4479b6244bd6d1dadf289a8d44bdcca2 (diff) | |
Merge "Scale major axis when finger is oriented."
Diffstat (limited to 'services/input/InputReader.cpp')
| -rw-r--r-- | services/input/InputReader.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/services/input/InputReader.cpp b/services/input/InputReader.cpp index a4d5f35b2517..05f40ba40029 100644 --- a/services/input/InputReader.cpp +++ b/services/input/InputReader.cpp @@ -2641,9 +2641,11 @@ void TouchInputMapper::dispatchTouch(nsecs_t when, uint32_t policyFlags, int32_t c2 = signExtendNybble(in.orientation & 0x0f); if (c1 != 0 || c2 != 0) { orientation = atan2f(c1, c2) * 0.5f; - float minorAxisScale = (16.0f - pythag(c1, c2)) / 16.0f; - toolMinor *= minorAxisScale; - touchMinor *= minorAxisScale; + float scale = 1.0f + pythag(c1, c2) / 16.0f; + touchMajor *= scale; + touchMinor /= scale; + toolMajor *= scale; + toolMinor /= scale; } else { orientation = 0; } |