Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d1689f3b authored by Christopher R. Palmer's avatar Christopher R. Palmer Committed by Gerrit Code Review
Browse files

Fix another off-by-one error in computeEllipsis

In the START case, we can iterate back before the start of the
string.  A similar fix was previously applied to the MIDDLE
case of computeEllipsis:

commit 0e3c5e82
Author: Raph Levien <raph@google.com>
Date:   Thu Dec 4 13:26:07 2014 -0800

    Fix off-by-one error in computeEllipsis

Fixes JIRA: NIGHTLIES-1280.

Change-Id: I081eaec9bce5a8989c8fc1b0d440848b40a66158
parent eccafdf6
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -663,7 +663,7 @@ public class StaticLayout extends Layout {
                float sum = 0;
                int i;

                for (i = len; i >= 0; i--) {
                for (i = len; i > 0; i--) {
                    float w = widths[i - 1 + lineStart - widthStart];

                    if (w + sum + ellipsisWidth > avail) {