diff --git a/server/TracySourceView.cpp b/server/TracySourceView.cpp index 287c7538..fd62054c 100644 --- a/server/TracySourceView.cpp +++ b/server/TracySourceView.cpp @@ -30,6 +30,8 @@ SourceView::SourceView( ImFont* font ) , m_dataSize( 0 ) , m_targetLine( 0 ) , m_selectedLine( 0 ) + , m_hoveredLine( 0 ) + , m_hoveredSource( 0 ) , m_codeLen( 0 ) , m_highlightAddr( 0 ) , m_asmRelative( false ) @@ -323,6 +325,8 @@ bool SourceView::Disassemble( uint64_t symAddr, const Worker& worker ) void SourceView::Render( const Worker& worker ) { m_highlightAddr.Decay( 0 ); + m_hoveredLine.Decay( 0 ); + m_hoveredSource.Decay( 0 ); if( m_symAddr == 0 ) { @@ -845,7 +849,11 @@ void SourceView::RenderLine( const Line& line, int lineNum, uint32_t ipcnt, uint auto draw = ImGui::GetWindowDrawList(); const auto w = ImGui::GetWindowWidth(); const auto wpos = ImGui::GetCursorScreenPos(); - if( lineNum == m_selectedLine ) + if( m_fileStringIdx == m_hoveredSource && lineNum == m_hoveredLine ) + { + draw->AddRectFilled( wpos, wpos + ImVec2( w, ty+1 ), 0x22FFFFFF ); + } + else if( lineNum == m_selectedLine ) { draw->AddRectFilled( wpos, wpos + ImVec2( w, ty+1 ), 0xFF333322 ); } @@ -1022,6 +1030,11 @@ void SourceView::RenderAsmLine( const AsmLine& line, uint32_t ipcnt, uint32_t ip SelectAsmLines( srcidx.Idx(), srcline, worker, false ); } } + else + { + m_hoveredLine = srcline; + m_hoveredSource = srcidx.Idx(); + } } ImGui::SameLine( 0, 0 ); ImGui::ItemSize( ImVec2( stw * ( 32 - bufsz ), ty ), 0 ); diff --git a/server/TracySourceView.hpp b/server/TracySourceView.hpp index e0ba1129..a7eb46f6 100644 --- a/server/TracySourceView.hpp +++ b/server/TracySourceView.hpp @@ -80,6 +80,8 @@ private: size_t m_dataSize; int m_targetLine; int m_selectedLine; + DecayValue m_hoveredLine; + DecayValue m_hoveredSource; int m_displayMode; uint32_t m_codeLen; DecayValue m_highlightAddr;