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

Commit 819dc46a authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Improve ellipsize performance" into qt-dev

parents 71ee3123 5238a7a7
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -2350,7 +2350,10 @@ public abstract class Layout {
        final int ellipsisStringLen = ellipsisString.length();
        // Use the ellipsis string only if there are that at least as many characters to replace.
        final boolean useEllipsisString = ellipsisCount >= ellipsisStringLen;
        for (int i = 0; i < ellipsisCount; i++) {
        final int min = Math.max(0, start - ellipsisStart - lineStart);
        final int max = Math.min(ellipsisCount, end - ellipsisStart - lineStart);

        for (int i = min; i < max; i++) {
            final char c;
            if (useEllipsisString && i < ellipsisStringLen) {
                c = ellipsisString.charAt(i);
@@ -2359,11 +2362,9 @@ public abstract class Layout {
            }

            final int a = i + ellipsisStart + lineStart;
            if (start <= a && a < end) {
            dest[destoff + a - start] = c;
        }
    }
    }

    /**
     * Stores information about bidirectional (left-to-right or right-to-left)