From 7a9d4aecd32171a25e139bb91cd1755ed6bed5bc Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Tue, 15 Oct 2019 21:41:06 +0200 Subject: [PATCH] Fix graph height calculation. --- server/TracyView.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 2aee0b7e..249daefb 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -4400,17 +4400,13 @@ int View::DrawCpuData( int offset, double pxns, const ImVec2& wpos, bool hover, if( showFull ) { - ImGui::PushFont( m_smallFont ); - const auto sty = ImGui::GetFontSize(); - const auto sstep = sty + 1; - auto cpuData = m_worker.GetCpuData(); const auto cpuCnt = m_worker.GetCpuDataCpuCount(); assert( cpuCnt != 0 ); if( m_vd.drawCpuUsageGraph ) { - const auto cpuUsageHeight = floor( 40.f * ImGui::GetTextLineHeight() / 15.f ); + const auto cpuUsageHeight = floor( 30.f * ImGui::GetTextLineHeight() / 15.f ); if( wpos.y + offset + cpuUsageHeight + 3 >= yMin && wpos.y + offset <= yMax ) { const float cpuCntRev = 1.f / cpuCnt; @@ -4441,6 +4437,10 @@ int View::DrawCpuData( int offset, double pxns, const ImVec2& wpos, bool hover, offset += cpuUsageHeight + 3; } + ImGui::PushFont( m_smallFont ); + const auto sty = ImGui::GetFontSize(); + const auto sstep = sty + 1; + const auto origOffset = offset; for( int i=0; i