@@ -118,9 +118,13 @@ public final void render(TerminalEmulator mEmulator, Canvas canvas, int topRow,
118118 final int columnWidthSinceLastRun = column - lastRunStartColumn ;
119119 final int charsSinceLastRun = currentCharIndex - lastRunStartIndex ;
120120 int cursorColor = lastRunInsideCursor ? mEmulator .mColors .mCurrentColors [TextStyle .COLOR_INDEX_CURSOR ] : 0 ;
121+ boolean invertCursorTextColor = false ;
122+ if (lastRunInsideCursor && cursorShape == TerminalEmulator .TERMINAL_CURSOR_STYLE_BLOCK ) {
123+ invertCursorTextColor = true ;
124+ }
121125 drawTextRun (canvas , line , palette , heightOffset , lastRunStartColumn , columnWidthSinceLastRun ,
122126 lastRunStartIndex , charsSinceLastRun , measuredWidthForRun ,
123- cursorColor , cursorShape , lastRunStyle , reverseVideo || lastRunInsideSelection );
127+ cursorColor , cursorShape , lastRunStyle , reverseVideo || invertCursorTextColor || lastRunInsideSelection );
124128 }
125129 measuredWidthForRun = 0.f ;
126130 lastRunStyle = style ;
@@ -143,8 +147,12 @@ public final void render(TerminalEmulator mEmulator, Canvas canvas, int topRow,
143147 final int columnWidthSinceLastRun = columns - lastRunStartColumn ;
144148 final int charsSinceLastRun = currentCharIndex - lastRunStartIndex ;
145149 int cursorColor = lastRunInsideCursor ? mEmulator .mColors .mCurrentColors [TextStyle .COLOR_INDEX_CURSOR ] : 0 ;
150+ boolean invertCursorTextColor = false ;
151+ if (lastRunInsideCursor && cursorShape == TerminalEmulator .TERMINAL_CURSOR_STYLE_BLOCK ) {
152+ invertCursorTextColor = true ;
153+ }
146154 drawTextRun (canvas , line , palette , heightOffset , lastRunStartColumn , columnWidthSinceLastRun , lastRunStartIndex , charsSinceLastRun ,
147- measuredWidthForRun , cursorColor , cursorShape , lastRunStyle , reverseVideo || lastRunInsideSelection );
155+ measuredWidthForRun , cursorColor , cursorShape , lastRunStyle , reverseVideo || invertCursorTextColor || lastRunInsideSelection );
148156 }
149157 }
150158
0 commit comments