mirror of
https://github.com/wolfpld/tracy
synced 2025-04-30 12:53:51 +00:00
Tighten line numbers in source view.
This commit is contained in:
parent
497e73182a
commit
14ec7ea6cd
@ -857,11 +857,14 @@ void SourceView::RenderLine( const Line& line, int lineNum, uint32_t ipcnt, uint
|
|||||||
ImGui::SameLine( 0, ty );
|
ImGui::SameLine( 0, ty );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const auto lineCount = m_lines.size();
|
||||||
|
const auto tmp = RealToString( lineCount );
|
||||||
|
const auto maxLine = strlen( tmp );
|
||||||
const auto lineString = RealToString( lineNum );
|
const auto lineString = RealToString( lineNum );
|
||||||
const auto linesz = strlen( lineString );
|
const auto linesz = strlen( lineString );
|
||||||
char buf[16];
|
char buf[16];
|
||||||
memset( buf, ' ', 7 - linesz );
|
memset( buf, ' ', maxLine - linesz );
|
||||||
memcpy( buf + 7 - linesz, lineString, linesz+1 );
|
memcpy( buf + maxLine - linesz, lineString, linesz+1 );
|
||||||
TextDisabledUnformatted( buf );
|
TextDisabledUnformatted( buf );
|
||||||
ImGui::SameLine( 0, ty );
|
ImGui::SameLine( 0, ty );
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user