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

Commit b1267ef7 authored by Hawkwood Glazier's avatar Hawkwood Glazier Committed by Android (Google) Code Review
Browse files

Merge "[DO NOT MERGE] Prevent TextInterpolator from rendering nonprintable...

Merge "[DO NOT MERGE] Prevent TextInterpolator from rendering nonprintable newlines" into tm-qpr-dev
parents 52ef44fe f50aadd2
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -485,7 +485,13 @@ class TextInterpolator(
        val out = mutableListOf<List<PositionedGlyphs>>()
        for (lineNo in 0 until layout.lineCount) { // Shape all lines.
            val lineStart = layout.getLineStart(lineNo)
            val count = layout.getLineEnd(lineNo) - lineStart
            var count = layout.getLineEnd(lineNo) - lineStart
            // Do not render the last character in the line if it's a newline and unprintable
            val last = lineStart + count - 1
            if (last > lineStart && last < layout.text.length && layout.text[last] == '\n') {
                count--
            }

            val runs = mutableListOf<PositionedGlyphs>()
            TextShaper.shapeText(layout.text, lineStart, count, layout.textDirectionHeuristic,
                    paint) { _, _, glyphs, _ ->