Skip to content

Commit

Permalink
Start first text run after the last column of bitmap, instead on the …
Browse files Browse the repository at this point in the history
…last column.

This creates a zero length text run, so skip it.
  • Loading branch information
MatanZ committed Sep 18, 2022
1 parent 8eb080a commit 329d5cb
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit 329d5cb

Please sign in to comment.