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

Commit 38dfd196 authored by Shu Chen's avatar Shu Chen
Browse files

Ensures the slop value is fixed cross lines.

In Q, the slop is a fixed value calculated based on
TextView.getLineHeight().
In R+ (before this cl), the slop is a dynamic value based on the height
of the current line.

It's been confirmed as the root cause of the regression bug b/159528374.

This cl changes the slop value back to the fixed value.

Bug: 159528374
Test: Verified locally.
Change-Id: I182d22779f1c1155ae2e0b0deb0455bd270b2fd9
parent fc0f8850
Loading
Loading
Loading
Loading
+2 −3
Original line number Original line Diff line number Diff line
@@ -6053,9 +6053,8 @@ public class Editor {
            return trueLine;
            return trueLine;
        }
        }


        final int lineHeight = layout.getLineBottom(prevLine) - layout.getLineTop(prevLine);
        final int lineHeight = mTextView.getLineHeight();
        int slop = (int)(mLineSlopRatio
        int slop = (int)(mLineSlopRatio * lineHeight);
                * (layout.getLineBottom(trueLine) - layout.getLineTop(trueLine)));
        slop = Math.max(mLineChangeSlopMin,
        slop = Math.max(mLineChangeSlopMin,
                Math.min(mLineChangeSlopMax, lineHeight + slop)) - lineHeight;
                Math.min(mLineChangeSlopMax, lineHeight + slop)) - lineHeight;
        slop = Math.max(0, slop);
        slop = Math.max(0, slop);