From 6e8d57bc984883bcab70fe14386942ea852358b6 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sat, 19 Jun 2021 16:50:25 +0200 Subject: [PATCH] Update context switches look. --- server/TracyView.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 783e7e39..f5cd4a70 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -6122,7 +6122,7 @@ int View::DrawCpuData( int offset, double pxns, const ImVec2& wpos, bool hover, const auto px0 = std::max( pr0, -10.0 ); const auto px1 = std::max( { std::min( pr1, double( w + 10 ) ), px0 + pxns * 0.5, px0 + MinVisSize } ); - uint32_t color, highlight; + uint32_t color; if( m_vd.dynamicColors != 0 ) { color = local ? GetThreadColor( thread, 0 ) : ( untracked ? 0xFF663333 : 0xFF444444 ); @@ -6131,18 +6131,20 @@ int View::DrawCpuData( int offset, double pxns, const ImVec2& wpos, bool hover, { color = local ? 0xFF334488 : ( untracked ? 0xFF663333 : 0xFF444444 ); } + + draw->AddRectFilled( wpos + ImVec2( px0, offset ), wpos + ImVec2( px1, offset + sty ), color ); if( m_drawThreadHighlight == thread ) { - highlight = 0xFFFFFFFF; + draw->AddRect( wpos + ImVec2( px0, offset ), wpos + ImVec2( px1, offset + sty ), 0xFFFFFFFF ); } else { - highlight = HighlightColor( color ); + const auto accentColor = HighlightColor( color ); + const auto darkColor = DarkenColor( color ); + DrawLine( draw, dpos + ImVec2( px0, offset + sty ), dpos + ImVec2( px0, offset ), dpos + ImVec2( px1-1, offset ), accentColor, 1.f ); + DrawLine( draw, dpos + ImVec2( px0, offset + sty ), dpos + ImVec2( px1-1, offset + sty ), dpos + ImVec2( px1-1, offset ), darkColor, 1.f ); } - draw->AddRectFilled( wpos + ImVec2( px0, offset ), wpos + ImVec2( px1, offset + sty ), color ); - draw->AddRect( wpos + ImVec2( px0, offset ), wpos + ImVec2( px1, offset + sty ), highlight ); - auto tsz = ImGui::CalcTextSize( label ); if( tsz.x < zsz ) {