From db16aecf644113af5097f75eee02653a9a9f4637 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sat, 28 Oct 2017 21:55:01 +0200 Subject: [PATCH] Try to display only frame time, if no space for full text. --- server/TracyView.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index d127f1f0..dce1a259 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -1777,9 +1777,15 @@ bool View::DrawZoneFrames() if( fsz >= 5 ) { auto buf = GetFrameText( i, ftime ); - const auto tx = ImGui::CalcTextSize( buf ).x; + auto tx = ImGui::CalcTextSize( buf ).x; uint32_t color = i == 0 ? 0xFF4444FF : 0xFFFFFFFF; + if( fsz - 5 <= tx ) + { + buf = TimeToString( ftime ); + tx = ImGui::CalcTextSize( buf ).x; + } + if( fbegin >= m_zvStart ) { draw->AddLine( wpos + ImVec2( ( fbegin - m_zvStart ) * pxns + 2, 1 ), wpos + ImVec2( ( fbegin - m_zvStart ) * pxns + 2, ty - 1 ), color );