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

Commit c3451d4a authored by Jeff Brown's avatar Jeff Brown
Browse files

Scale major axis when finger is oriented.

Change-Id: I281ec25478b4ceffa6ed5a41cb44a7e81d18d8dc
parent cfe89034
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;
                }