Merge "Fix missing ellipsis when just one character is truncated" into lmp-mr1-dev

This commit is contained in:
Chris Craik
2014-11-18 22:17:33 +00:00
committed by Android (Google) Code Review

View File

@@ -383,7 +383,6 @@ public class StaticLayout extends Layout {
okBottom = fitBottom; okBottom = fitBottom;
} }
} else { } else {
final boolean moreChars;
int endPos; int endPos;
int above, below, top, bottom; int above, below, top, bottom;
float currentTextWidth; float currentTextWidth;
@@ -395,7 +394,6 @@ public class StaticLayout extends Layout {
top = okTop; top = okTop;
bottom = okBottom; bottom = okBottom;
currentTextWidth = okWidth; currentTextWidth = okWidth;
moreChars = (j + 1 < spanEnd);
} else if (fit != here) { } else if (fit != here) {
endPos = fit; endPos = fit;
above = fitAscent; above = fitAscent;
@@ -403,7 +401,6 @@ public class StaticLayout extends Layout {
top = fitTop; top = fitTop;
bottom = fitBottom; bottom = fitBottom;
currentTextWidth = fitWidth; currentTextWidth = fitWidth;
moreChars = (j + 1 < spanEnd);
} else { } else {
// must make progress, so take next character // must make progress, so take next character
endPos = here + 1; endPos = here + 1;
@@ -417,7 +414,6 @@ public class StaticLayout extends Layout {
top = fmTop; top = fmTop;
bottom = fmBottom; bottom = fmBottom;
currentTextWidth = widths[here - paraStart]; currentTextWidth = widths[here - paraStart];
moreChars = (endPos < spanEnd);
} }
v = out(source, here, endPos, v = out(source, here, endPos,
@@ -425,7 +421,7 @@ public class StaticLayout extends Layout {
v, spacingmult, spacingadd, chooseHt,chooseHtv, fm, hasTabOrEmoji, v, spacingmult, spacingadd, chooseHt,chooseHtv, fm, hasTabOrEmoji,
needMultiply, chdirs, dir, easy, bufEnd, includepad, trackpad, needMultiply, chdirs, dir, easy, bufEnd, includepad, trackpad,
chs, widths, paraStart, ellipsize, ellipsizedWidth, chs, widths, paraStart, ellipsize, ellipsizedWidth,
currentTextWidth, paint, moreChars); currentTextWidth, paint, true);
here = endPos; here = endPos;
j = here - 1; // restart j-span loop from here, compensating for the j++ j = here - 1; // restart j-span loop from here, compensating for the j++