Loading core/java/android/text/Layout.java +1 −0 Original line number Diff line number Diff line Loading @@ -1121,6 +1121,7 @@ public abstract class Layout { * closest to the specified horizontal position. */ public int getOffsetForHorizontal(int line, float horiz) { // TODO: use Paint.getOffsetForAdvance to avoid binary search int max = getLineEnd(line) - 1; int min = getLineStart(line); Directions dirs = getLineDirections(line); Loading core/java/android/text/TextLine.java +4 −6 Original line number Diff line number Diff line Loading @@ -739,16 +739,14 @@ class TextLine { float ret = 0; int contextLen = contextEnd - contextStart; if (needWidth || (c != null && (wp.bgColor != 0 || wp.underlineColor != 0 || runIsRtl))) { if (mCharsValid) { ret = wp.getTextRunAdvances(mChars, start, runLen, contextStart, contextLen, runIsRtl, null, 0); ret = wp.getRunAdvance(mChars, start, contextEnd, contextStart, contextEnd, runIsRtl, end); } else { int delta = mStart; ret = wp.getTextRunAdvances(mText, delta + start, delta + end, delta + contextStart, delta + contextEnd, runIsRtl, null, 0); ret = wp.getRunAdvance(mText, delta + start, delta + contextEnd, delta + contextStart, delta + contextEnd, runIsRtl, delta + end); } } Loading Loading
core/java/android/text/Layout.java +1 −0 Original line number Diff line number Diff line Loading @@ -1121,6 +1121,7 @@ public abstract class Layout { * closest to the specified horizontal position. */ public int getOffsetForHorizontal(int line, float horiz) { // TODO: use Paint.getOffsetForAdvance to avoid binary search int max = getLineEnd(line) - 1; int min = getLineStart(line); Directions dirs = getLineDirections(line); Loading
core/java/android/text/TextLine.java +4 −6 Original line number Diff line number Diff line Loading @@ -739,16 +739,14 @@ class TextLine { float ret = 0; int contextLen = contextEnd - contextStart; if (needWidth || (c != null && (wp.bgColor != 0 || wp.underlineColor != 0 || runIsRtl))) { if (mCharsValid) { ret = wp.getTextRunAdvances(mChars, start, runLen, contextStart, contextLen, runIsRtl, null, 0); ret = wp.getRunAdvance(mChars, start, contextEnd, contextStart, contextEnd, runIsRtl, end); } else { int delta = mStart; ret = wp.getTextRunAdvances(mText, delta + start, delta + end, delta + contextStart, delta + contextEnd, runIsRtl, null, 0); ret = wp.getRunAdvance(mText, delta + start, delta + contextEnd, delta + contextStart, delta + contextEnd, runIsRtl, delta + end); } } Loading