From 4b548156b15961eaac02f8e94d4f0866d4b2b27e Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sun, 26 Nov 2017 02:24:13 +0100 Subject: [PATCH] Proper display of negative time. --- server/TracyView.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 92de39e2..550f6978 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -1989,10 +1989,15 @@ bool View::DrawZoneFrames() if( tw == 0 ) { char buf[128]; - auto txt = TimeToString( m_zvStart - m_frames[0] ); - sprintf( buf, "+%s", txt ); - draw->AddText( wpos + ImVec2( x, round( ty * 0.5 ) ), 0x66FFFFFF, buf ); - tw = ImGui::CalcTextSize( buf ).x; + const auto t = m_zvStart - m_frames[0]; + auto txt = TimeToString( t ); + if( t >= 0 ) + { + sprintf( buf, "+%s", txt ); + txt = buf; + } + draw->AddText( wpos + ImVec2( x, round( ty * 0.5 ) ), 0x66FFFFFF, txt ); + tw = ImGui::CalcTextSize( txt ).x; } else if( x > tx + tw + ty * 2 ) {