perf opt
don't draw invisible chars in the Code Editor
This commit is contained in:
		
							
								
								
									
										17
									
								
								src/code.c
									
									
									
									
									
								
							
							
						
						
									
										17
									
								
								src/code.c
									
									
									
									
									
								
							@@ -83,14 +83,17 @@ static void drawCode(Code* code, bool withCursor)
 | 
				
			|||||||
	{
 | 
						{
 | 
				
			||||||
		char symbol = *pointer;
 | 
							char symbol = *pointer;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if(code->cursor.selection && pointer >= selection.start && pointer < selection.end)
 | 
							if(x >= -TIC_FONT_WIDTH && x < TIC80_WIDTH && y >= -TIC_FONT_HEIGHT && y < TIC80_HEIGHT )
 | 
				
			||||||
			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)
 | 
								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.draw_char(code->tic, symbol, x+1, y+1, 0);
 | 
								else if(getConfig()->theme.code.shadow)
 | 
				
			||||||
        }
 | 
								{
 | 
				
			||||||
 | 
									code->tic->api.draw_char(code->tic, symbol, x+1, y+1, 0);
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		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;
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user