From c28bab59b57700e20a2c6640c8e327612ab2caf0 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Tue, 15 Oct 2019 21:20:00 +0200 Subject: [PATCH] Improve look of CPU usage graph. --- server/TracyView.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 5d939b60..934b632f 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -4408,8 +4408,8 @@ int View::DrawCpuData( int offset, double pxns, const ImVec2& wpos, bool hover, const auto cpuCnt = m_worker.GetCpuDataCpuCount(); assert( cpuCnt != 0 ); - const auto cpuUsageHeight = 40 * ImGui::GetTextLineHeight() / 15.f; - if( wpos.y + offset + cpuUsageHeight + 2 >= yMin && wpos.y + offset <= yMax ) + const auto cpuUsageHeight = floor( 40.f * ImGui::GetTextLineHeight() / 15.f ); + if( wpos.y + offset + cpuUsageHeight + 3 >= yMin && wpos.y + offset <= yMax ) { const float cpuCntRev = 1.f / cpuCnt; float pos = 0; @@ -4434,8 +4434,9 @@ int View::DrawCpuData( int offset, double pxns, const ImVec2& wpos, bool hover, } pos++; } + draw->AddLine( wpos + ImVec2( 0, offset+cpuUsageHeight+2 ), wpos + ImVec2( w, offset+cpuUsageHeight+2 ), 0x22DD88DD ); } - offset += cpuUsageHeight + 2; + offset += cpuUsageHeight + 3; const auto origOffset = offset; for( int i=0; i