diff --git a/server/TracySourceView.cpp b/server/TracySourceView.cpp index d4aeb6b5..f1fc9dbf 100644 --- a/server/TracySourceView.cpp +++ b/server/TracySourceView.cpp @@ -2372,12 +2372,7 @@ uint64_t SourceView::RenderSymbolAsmView( const AddrStatData& as, Worker& worker const auto ts = ImGui::CalcTextSize( " " ); const auto th2 = floor( ts.y / 2 ); const auto th4 = floor( ts.y / 4 ); - const auto xoff = round( - ( ( as.ipTotalAsm.local + as.ipTotalAsm.ext ) == 0 ? 0 : ( 7 * ts.x + ts.y ) ) + - (3+maxAddrLen) * ts.x + - ( ( m_asmShowSourceLocation && !m_sourceFiles.empty() ) ? 36 * ts.x : 0 ) + - ( m_asmBytes ? m_maxAsmBytes*3 * ts.x : 0 ) + - ( ( m_hwSamples && worker.GetHwSampleCountAddress() != 0 ) ? ( 19 * ts.x + ts.y ) : 0 ) ); + const auto xoff = m_jumpOffset; const auto minAddr = m_asm[clipper.DisplayStart].addr; const auto maxAddr = m_asm[clipper.DisplayEnd-1].addr; const auto mjl = m_maxJumpLevel; @@ -3564,8 +3559,12 @@ void SourceView::RenderAsmLine( AsmLine& line, const AddrStat& ipcnt, const Addr } if( m_showJumps ) { + ImGui::SameLine( 0, 0 ); + const auto xoff = ImGui::GetCursorScreenPos().x - wpos.x + round( ty * 0.66f ); + m_jumpOffset = xoff; + const auto JumpArrow = JumpArrowBase * ty / 15; - ImGui::SameLine( 0, 2*ty + JumpArrow + m_maxJumpLevel * JumpSeparation ); + ImGui::SameLine( 0, ty + JumpArrow + m_maxJumpLevel * JumpSeparation ); auto jit = m_jumpOut.find( line.addr ); if( jit != m_jumpOut.end() ) { @@ -3573,12 +3572,6 @@ void SourceView::RenderAsmLine( AsmLine& line, const AddrStat& ipcnt, const Addr const auto th4 = floor( ts.y / 4 ); const auto& mjl = m_maxJumpLevel; const auto col = GetHsvColor( line.jumpAddr, 6 ); - const auto xoff = round( - ( ( as.ipTotalAsm.local + as.ipTotalAsm.ext == 0 ) ? 0 : ( 7 * ts.x + ts.y ) ) + - (3+maxAddrLen) * ts.x + - ( ( m_asmShowSourceLocation && !m_sourceFiles.empty() ) ? 36 * ts.x : 0 ) + - ( m_asmBytes ? m_maxAsmBytes*3 * ts.x : 0 ) + - ( showHwSamples ? ( 19 * ts.x + ts.y ) : 0 ) ); DrawLine( draw, dpos + ImVec2( xoff + JumpSeparation * mjl + th2, th2 ), dpos + ImVec2( xoff + JumpSeparation * mjl + th2 + JumpArrow / 2, th2 ), col ); DrawLine( draw, dpos + ImVec2( xoff + JumpSeparation * mjl + th2, th2 ), dpos + ImVec2( xoff + JumpSeparation * mjl + th2 + th4, th2 - th4 ), col ); diff --git a/server/TracySourceView.hpp b/server/TracySourceView.hpp index 4ffbde2b..57d3a697 100644 --- a/server/TracySourceView.hpp +++ b/server/TracySourceView.hpp @@ -256,6 +256,7 @@ private: float m_srcWidth; float m_asmWidth; + float m_jumpOffset; GetWindowCallback m_gwcb; Tokenizer m_tokenizer;