don't draw invisible chars in the Code Editor
This commit is contained in:
BADIM-PC\Vadim 2017-12-21 00:10:44 +03:00
parent bd02083b09
commit 71c7144aa5
1 changed files with 10 additions and 7 deletions

View File

@ -83,6 +83,8 @@ static void drawCode(Code* code, bool withCursor)
{ {
char symbol = *pointer; char symbol = *pointer;
if(x >= -TIC_FONT_WIDTH && x < TIC80_WIDTH && y >= -TIC_FONT_HEIGHT && y < TIC80_HEIGHT )
{
if(code->cursor.selection && pointer >= selection.start && pointer < selection.end) if(code->cursor.selection && pointer >= selection.start && pointer < selection.end)
code->tic->api.rect(code->tic, x-1, y-1, TIC_FONT_WIDTH+1, TIC_FONT_HEIGHT+1, getConfig()->theme.code.select); code->tic->api.rect(code->tic, x-1, y-1, TIC_FONT_WIDTH+1, TIC_FONT_HEIGHT+1, getConfig()->theme.code.select);
else if(getConfig()->theme.code.shadow) else if(getConfig()->theme.code.shadow)
@ -91,6 +93,7 @@ static void drawCode(Code* code, bool withCursor)
} }
code->tic->api.draw_char(code->tic, symbol, x, y, *colorPointer); code->tic->api.draw_char(code->tic, symbol, x, y, *colorPointer);
}
if(code->cursor.position == pointer) if(code->cursor.position == pointer)
cursor.x = x, cursor.y = y, cursor.symbol = symbol; cursor.x = x, cursor.y = y, cursor.symbol = symbol;