From 54baec9e7e4ad29af613b17376cb15883b35968b Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sun, 21 Oct 2018 17:46:24 +0200 Subject: [PATCH] Fix drawing last collapsed non-contiguous frame. --- server/TracyView.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 91a50313..26ea005d 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -1446,7 +1446,16 @@ bool View::DrawZoneFrames( const FrameData& frames ) if( prev != -1 ) { - DrawZigZag( draw, wpos + ImVec2( 0, round( ty / 2 ) ), ( prev - m_zvStart ) * pxns, ( m_worker.GetFrameBegin( frames, zrange.second-1 ) - m_zvStart ) * pxns, ty / 4, inactiveColor ); + if( frames.continuous ) + { + DrawZigZag( draw, wpos + ImVec2( 0, round( ty / 2 ) ), ( prev - m_zvStart ) * pxns, ( m_worker.GetFrameBegin( frames, zrange.second-1 ) - m_zvStart ) * pxns, ty / 4, inactiveColor ); + } + else + { + const auto begin = ( prev - m_zvStart ) * pxns; + const auto end = ( m_worker.GetFrameBegin( frames, zrange.second-1 ) - m_zvStart ) * pxns; + DrawZigZag( draw, wpos + ImVec2( 0, round( ty / 2 ) ), begin, std::max( begin + MinFrameSize, end ), ty / 4, inactiveColor ); + } prev = -1; }