Merge "Ensures the slop value is fixed cross lines."

This commit is contained in:
TreeHugger Robot
2020-07-22 03:22:44 +00:00
committed by Android (Google) Code Review

View File

@@ -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);