From a6c0ac427379c54754e9009a28fc790b5ac4b803 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Fri, 10 Apr 2020 00:40:31 +0200 Subject: [PATCH] Tighten assembly counts in source view. --- server/TracySourceView.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/server/TracySourceView.cpp b/server/TracySourceView.cpp index f7400546..af8ee370 100644 --- a/server/TracySourceView.cpp +++ b/server/TracySourceView.cpp @@ -881,6 +881,8 @@ void SourceView::RenderLine( const Line& line, int lineNum, uint32_t ipcnt, uint match += ( addr >= m_baseAddr && addr < m_baseAddr + m_codeLen ); } } + const auto tmp = RealToString( m_asm.size() ); + const auto maxAsm = strlen( tmp ) + 1; if( match > 0 ) { const auto asmString = RealToString( match ); @@ -888,11 +890,11 @@ void SourceView::RenderLine( const Line& line, int lineNum, uint32_t ipcnt, uint const auto asmsz = strlen( buf ); TextDisabledUnformatted( buf ); ImGui::SameLine( 0, 0 ); - ImGui::ItemSize( ImVec2( stw * ( 8 - asmsz ), ty ), 0 ); + ImGui::ItemSize( ImVec2( stw * ( maxAsm - asmsz ), ty ), 0 ); } else { - ImGui::ItemSize( ImVec2( stw * 8, ty ), 0 ); + ImGui::ItemSize( ImVec2( stw * maxAsm, ty ), 0 ); } }