am 2f0e6f0c: Merge "Fix off-by-one error in computeEllipsis" into lmp-mr1-dev

* commit '2f0e6f0c7f52427ff542ebb9a28aa489a0f1f909':
  Fix off-by-one error in computeEllipsis
This commit is contained in:
Raph Levien
2014-12-04 22:39:04 +00:00
committed by Android Git Automerger

View File

@@ -416,7 +416,11 @@ public class StaticLayout extends Layout {
currentTextWidth = widths[here - paraStart];
}
v = out(source, here, endPos,
int ellipseEnd = endPos;
if (mMaximumVisibleLineCount == 1 && ellipsize == TextUtils.TruncateAt.MIDDLE) {
ellipseEnd = paraEnd;
}
v = out(source, here, ellipseEnd,
above, below, top, bottom,
v, spacingmult, spacingadd, chooseHt,chooseHtv, fm, hasTabOrEmoji,
needMultiply, chdirs, dir, easy, bufEnd, includepad, trackpad,
@@ -704,7 +708,7 @@ public class StaticLayout extends Layout {
int left = 0, right = len;
float ravail = (avail - ellipsisWidth) / 2;
for (right = len; right >= 0; right--) {
for (right = len; right > 0; right--) {
float w = widths[right - 1 + lineStart - widthStart];
if (w + rsum > ravail) {