diff options
| author | 2020-07-22 03:22:44 +0000 | |
|---|---|---|
| committer | 2020-07-22 03:22:44 +0000 | |
| commit | 172b4510d1520c8cdec5fe3e48fdbacb015dff71 (patch) | |
| tree | b6e4dfef7fa7fb53725b6f38117606a2524c1112 | |
| parent | 54f5e7335c4f58436f8d19cb8ad588e88368e3c8 (diff) | |
| parent | 38dfd19611160e8f182d42040f6821f151353716 (diff) | |
Merge "Ensures the slop value is fixed cross lines."
| -rw-r--r-- | core/java/android/widget/Editor.java | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/core/java/android/widget/Editor.java b/core/java/android/widget/Editor.java index 346bbb6fd409..c4eb39626d8b 100644 --- a/core/java/android/widget/Editor.java +++ b/core/java/android/widget/Editor.java @@ -6053,9 +6053,8 @@ public class Editor { return trueLine; } - final int lineHeight = layout.getLineBottom(prevLine) - layout.getLineTop(prevLine); - int slop = (int)(mLineSlopRatio - * (layout.getLineBottom(trueLine) - layout.getLineTop(trueLine))); + final int lineHeight = mTextView.getLineHeight(); + int slop = (int)(mLineSlopRatio * lineHeight); slop = Math.max(mLineChangeSlopMin, Math.min(mLineChangeSlopMax, lineHeight + slop)) - lineHeight; slop = Math.max(0, slop); |