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

Commit 9123ced2 authored by Keisuke Kuroyanagi's avatar Keisuke Kuroyanagi Committed by Android (Google) Code Review
Browse files

Merge "Make ellipsis START and MIDDLE grapheme cluster aware."

parents cebb2882 82d1c443
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -279,7 +279,9 @@ class MeasuredText {
                if (width < 0.0f) break;
                i--;
            }
            while (i < limit - 1 && mChars[i + 1] == ' ') i++;
            while (i < limit - 1 && (mChars[i + 1] == ' ' || w[i + 1] == 0.0f)) {
                i++;
            }
            return limit - i - 1;
        }
    }
+6 −2
Original line number Diff line number Diff line
@@ -1029,8 +1029,10 @@ public class StaticLayout extends Layout {

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

                    if (w + sum + ellipsisWidth > avail) {
                        while (i < len && widths[i + lineStart - widthStart] == 0.0f) {
                            i++;
                        }
                        break;
                    }

@@ -1076,9 +1078,11 @@ public class StaticLayout extends Layout {
                    float w = widths[right - 1 + lineStart - widthStart];

                    if (w + rsum > ravail) {
                        while (right < len && widths[right + lineStart - widthStart] == 0.0f) {
                            right++;
                        }
                        break;
                    }

                    rsum += w;
                }