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

Commit b5fd7ae4 authored by Jeff Brown's avatar Jeff Brown Committed by Android (Google) Code Review
Browse files

Merge "Scale major axis when finger is oriented."

parents 8c5d38f8 c3451d4a
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -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;
                }