Skip to content

Commit

Permalink
correctly display text under cursor in underdash/vertical line cursor…
Browse files Browse the repository at this point in the history
… mode.
  • Loading branch information
yatli committed Aug 15, 2016
1 parent 22a9cc1 commit 103b9c5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ abstract class BaseTextRenderer implements TextRenderer {
private Bitmap mCursorBitmap;
private Bitmap mWorkBitmap;
private int mCursorBitmapCursorMode = -1;
private int mCursorStyle = 0;
protected int mCursorStyle = 0;

public BaseTextRenderer(ColorScheme scheme) {
if (scheme == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,11 @@ public void drawTextRun(Canvas canvas, float x, float y, int lineOffset,
canvas.drawText(text, index, countBeforeCursor, left, textOriginY, mTextPaint);
}
// Text at cursor
mTextPaint.setColor(mPalette[TextStyle.ciCursorForeground]);
// Only use invert color with BLOCK cursor.
// For underdash and vertical line, use normal color.
if(mCursorStyle == 0) {
mTextPaint.setColor(mPalette[TextStyle.ciCursorForeground]);
}
canvas.drawText(text, cursorIndex, cursorIncr, cursorX,
textOriginY, mTextPaint);
// Text after cursor
Expand Down

0 comments on commit 103b9c5

Please sign in to comment.