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

Commit 28565a9e authored by Raph Levien's avatar Raph Levien Committed by Android Git Automerger
Browse files

am 0dc8c30d: Merge "Ignore width of trailing whitespace for computing ellipsis" into lmp-dev

* commit '0dc8c30d6f4a8e4cecd9ab0749497227e0f561e4':
  Ignore width of trailing whitespace for computing ellipsis
parents 6f2b2b0c 7de5c43c
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -262,6 +262,8 @@ public class StaticLayout extends Layout {
            int fit = paraStart;
            float fitWidth = w;
            int fitAscent = 0, fitDescent = 0, fitTop = 0, fitBottom = 0;
            // same as fitWidth but not including any trailing whitespace
            float fitWidthGraphing = w;

            boolean hasTabOrEmoji = false;
            boolean hasTab = false;
@@ -346,6 +348,9 @@ public class StaticLayout extends Layout {

                    if (w <= width || isSpaceOrTab) {
                        fitWidth = w;
                        if (!isSpaceOrTab) {
                            fitWidthGraphing = w;
                        }
                        fit = j + 1;

                        if (fmTop < fitTop)
@@ -365,7 +370,7 @@ public class StaticLayout extends Layout {
                                breakOpp[breakOppIndex] == j - paraStart + 1;

                        if (isLineBreak) {
                            okWidth = w;
                            okWidth = fitWidthGraphing;
                            ok = j + 1;

                            if (fitTop < okTop)
@@ -426,6 +431,7 @@ public class StaticLayout extends Layout {
                        j = here - 1; // restart j-span loop from here, compensating for the j++
                        ok = fit = here;
                        w = 0;
                        fitWidthGraphing = w;
                        fitAscent = fitDescent = fitTop = fitBottom = 0;
                        okAscent = okDescent = okTop = okBottom = 0;