From 0d8b79f6c945d0026826a33687deb7c7b022ed4b Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Fri, 5 Oct 2018 20:59:00 +0200 Subject: [PATCH] Don't miss frame separators. --- server/TracyView.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index d17b9363..7c4b553e 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -1293,6 +1293,7 @@ bool View::DrawZoneFrames( const FrameData& frames ) int64_t prev = -1; int64_t prevEnd = -1; + int64_t endPos = -1; bool tooltipDisplayed = false; for( int i = zrange.first; i < zrange.second; i++ ) @@ -1356,14 +1357,15 @@ bool View::DrawZoneFrames( const FrameData& frames ) if( m_frames == &frames ) { - if( fbegin >= m_zvStart ) + if( fbegin >= m_zvStart && endPos != fbegin ) { draw->AddLine( wpos + ImVec2( ( fbegin - m_zvStart ) * pxns, 0 ), wpos + ImVec2( ( fbegin - m_zvStart ) * pxns, wh ), 0x22FFFFFF ); } - if( !frames.continuous && fend <= m_zvEnd ) + if( fend <= m_zvEnd ) { draw->AddLine( wpos + ImVec2( ( fend - m_zvStart ) * pxns, 0 ), wpos + ImVec2( ( fend - m_zvStart ) * pxns, wh ), 0x22FFFFFF ); } + endPos = fend; } auto buf = GetFrameText( frames, i, ftime, m_worker.GetFrameOffset() ); @@ -1403,12 +1405,6 @@ bool View::DrawZoneFrames( const FrameData& frames ) prev = -1; } - const auto fend = m_worker.GetFrameEnd( frames, zrange.second-1 ); - if( fend == m_zvEnd ) - { - draw->AddLine( wpos + ImVec2( ( fend - m_zvStart ) * pxns, 0 ), wpos + ImVec2( ( fend - m_zvStart ) * pxns, wh ), 0x22FFFFFF ); - } - if( hover && !tooltipDisplayed ) { ImGui::BeginTooltip();