diff options
Diffstat (limited to 'core/java/android/text/Layout.java')
-rwxr-xr-x[-rw-r--r--] | core/java/android/text/Layout.java | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/core/java/android/text/Layout.java b/core/java/android/text/Layout.java index 38ac9b7..4e197cd 100644..100755 --- a/core/java/android/text/Layout.java +++ b/core/java/android/text/Layout.java @@ -749,6 +749,9 @@ public abstract class Layout { if (line == getLineCount() - 1) max++; + if (line != getLineCount() - 1) + max = TextUtils.getOffsetBefore(mText, getLineEnd(line)); + int best = min; float bestdist = Math.abs(getPrimaryHorizontal(best) - horiz); @@ -893,7 +896,7 @@ public abstract class Layout { Directions dirs = getLineDirections(line); if (line != getLineCount() - 1) - end--; + end = TextUtils.getOffsetBefore(mText, end); float horiz = getPrimaryHorizontal(offset); @@ -993,7 +996,7 @@ public abstract class Layout { Directions dirs = getLineDirections(line); if (line != getLineCount() - 1) - end--; + end = TextUtils.getOffsetBefore(mText, end); float horiz = getPrimaryHorizontal(offset); @@ -1564,7 +1567,8 @@ public abstract class Layout { h = dir * nextTab(text, start, end, h * dir, tabs); } - if (bm != null) { + if (j != there && bm != null) { + if (offset == start + j) return h; workPaint.set(paint); Styled.measureText(paint, workPaint, text, j, j + 2, null); @@ -1958,4 +1962,3 @@ public abstract class Layout { new Directions(new short[] { 0, 32767 }); } - |