Store syntax colors as 32-bit uints.

This commit is contained in:
Bartosz Taudul
2022-09-11 00:44:26 +02:00
parent f8cf7ff45a
commit c27bcc524c
3 changed files with 17 additions and 26 deletions

View File

@@ -209,7 +209,9 @@ static void PrintSourceFragment( const SourceContents& src, uint32_t srcline, in
ImGui::TextUnformatted( ptr, it->begin );
ImGui::SameLine( 0, 0 );
}
TextColoredUnformatted( i == srcline-1 ? SyntaxColors[(int)it->color] : SyntaxColorsDimmed[(int)it->color], it->begin, it->end );
auto color = SyntaxColors[(int)it->color];
if( i != srcline-1 ) color = ( color & 0xFFFFFF ) | 0x99000000;
TextColoredUnformatted( color, it->begin, it->end );
ImGui::SameLine( 0, 0 );
ptr = it->end;
++it;