From 5ae2c415b7bd1a38409970727f1598f23996d8ec Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sat, 25 Apr 2020 13:52:21 +0200 Subject: [PATCH] Draw a line indicating zeroth column of source code. --- server/TracySourceView.cpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/server/TracySourceView.cpp b/server/TracySourceView.cpp index f97ce283..2ce15dee 100644 --- a/server/TracySourceView.cpp +++ b/server/TracySourceView.cpp @@ -368,6 +368,18 @@ void SourceView::RenderSimpleSourceView() { ImGui::BeginChild( "##sourceView", ImVec2( 0, 0 ), true ); if( m_font ) ImGui::PushFont( m_font ); + + auto draw = ImGui::GetWindowDrawList(); + const auto wpos = ImGui::GetWindowPos(); + const auto wh = ImGui::GetWindowHeight(); + const auto ty = ImGui::GetFontSize(); + const auto ts = ImGui::CalcTextSize( " " ).x; + const auto lineCount = m_lines.size(); + const auto tmp = RealToString( lineCount ); + const auto maxLine = strlen( tmp ); + const auto lx = ts * maxLine + ty + round( ts*0.4f ); + draw->AddLine( wpos + ImVec2( lx, 0 ), wpos + ImVec2( lx, wh ), 0x08FFFFFF ); + if( m_targetLine != 0 ) { int lineNum = 1; @@ -819,6 +831,24 @@ void SourceView::RenderSymbolSourceView( uint32_t iptotal, unordered_flat_mapAddLine( wpos + ImVec2( lx, 0 ), wpos + ImVec2( lx, wh ), 0x08FFFFFF ); + m_selectedAddressesHover.clear(); if( m_targetLine != 0 ) {