From d607bf64623c0c8f9dd574374de811fe40de0189 Mon Sep 17 00:00:00 2001 From: Matan Ziv-Av Date: Sun, 18 Sep 2022 16:49:12 +0300 Subject: [PATCH] Start first text run after the last column of bitmap, instead on the last column. This creates a zero length text run, so skip it. --- .../src/main/java/com/termux/view/TerminalRenderer.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/terminal-view/src/main/java/com/termux/view/TerminalRenderer.java b/terminal-view/src/main/java/com/termux/view/TerminalRenderer.java index 1ca399745b..ded5f54a5d 100644 --- a/terminal-view/src/main/java/com/termux/view/TerminalRenderer.java +++ b/terminal-view/src/main/java/com/termux/view/TerminalRenderer.java @@ -115,7 +115,7 @@ public final void render(TerminalEmulator mEmulator, Canvas canvas, int topRow, measuredWidthForRun = 0.f; lastRunStyle = 0; lastRunInsideCursor = false; - lastRunStartColumn = column; + lastRunStartColumn = column + 1; lastRunStartIndex = currentCharIndex; lastRunFontWidthMismatch = false; currentCharIndex += charsForCodePoint; @@ -134,7 +134,7 @@ public final void render(TerminalEmulator mEmulator, Canvas canvas, int topRow, final boolean fontWidthMismatch = Math.abs(measuredCodePointWidth / mFontWidth - codePointWcWidth) > 0.01; if (style != lastRunStyle || insideCursor != lastRunInsideCursor || insideSelection != lastRunInsideSelection || fontWidthMismatch || lastRunFontWidthMismatch) { - if (column == 0) { + if (column == 0 || column == lastRunStartColumn) { // Skip first column as there is nothing to draw, just record the current style. } else { final int columnWidthSinceLastRun = column - lastRunStartColumn;