From c04824890d6d5855dd6b322309d70d52f889717d Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Wed, 29 Jan 2020 02:17:13 +0100 Subject: [PATCH] Add border to frame range highlight. --- server/TracyView.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 2b0a3e67..59bedd66 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -1493,8 +1493,16 @@ void View::DrawFrames() auto x0 = std::max( 0, ( zrange.first - m_vd.frameStart ) * fwidth / group ); if( x0 == x1 ) x1 = x0 + 1; - - draw->AddRectFilled( wpos + ImVec2( 1+x0, 0 ), wpos + ImVec2( 1+x1, Height ), 0x55DD22DD ); + if( x1 - x0 >= 3 ) + { + draw->AddRectFilled( wpos + ImVec2( 2+x0, 0 ), wpos + ImVec2( x1, Height ), 0x55DD22DD ); + draw->AddLine( wpos + ImVec2( 1+x0, -1 ), wpos + ImVec2( 1+x0, Height-1 ), 0x55FF55FF ); + draw->AddLine( wpos + ImVec2( x1, -1 ), wpos + ImVec2( x1, Height-1 ), 0x55FF55FF ); + } + else + { + draw->AddRectFilled( wpos + ImVec2( 1+x0, 0 ), wpos + ImVec2( 1+x1, Height ), 0x55FF55FF ); + } } draw->AddLine( wpos + ImVec2( 0, round( Height - Height * BadTime / MaxFrameTime ) ), wpos + ImVec2( w, round( Height - Height * BadTime / MaxFrameTime ) ), 0x4422DDDD );