From 2f5f2e5b1d5021da09f5b092e9c5d2c35d776428 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Wed, 29 Jul 2020 18:07:50 +0200 Subject: [PATCH] Add range boundary highlight. --- server/TracyView.cpp | 4 +++- server/TracyView.hpp | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 95ee4c11..86a2d440 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -2294,6 +2294,7 @@ void View::DrawZones() m_cpuDataThread.Decay( 0 ); m_zoneHover = nullptr; m_zoneHover2.Decay( nullptr ); + m_findZone.range.StartFrame(); if( m_vd.zvStart == m_vd.zvEnd ) return; assert( m_vd.zvStart < m_vd.zvEnd ); @@ -3075,7 +3076,8 @@ void View::DrawZones() const auto px0 = ( m_findZone.range.min - m_vd.zvStart ) * pxns; const auto px1 = std::max( px0 + std::max( 1.0, pxns * 0.5 ), ( m_findZone.range.max - m_vd.zvStart ) * pxns ); DrawStripedRect( draw, wpos.x + px0, linepos.y, wpos.x + px1, linepos.y + lineh, 10 * ImGui::GetTextLineHeight() / 15.f, 0x2288DDDD ); - draw->AddRect( ImVec2( wpos.x + px0, linepos.y ), ImVec2( wpos.x + px1, linepos.y + lineh ), 0x3388DDDD ); + draw->AddLine( ImVec2( wpos.x + px0, linepos.y ), ImVec2( wpos.x + px0, linepos.y + lineh ), m_findZone.range.hiMin ? 0x9988DDDD : 0x3388DDDD, m_findZone.range.hiMin ? 2 : 1 ); + draw->AddLine( ImVec2( wpos.x + px1, linepos.y ), ImVec2( wpos.x + px1, linepos.y + lineh ), m_findZone.range.hiMax ? 0x9988DDDD : 0x3388DDDD, m_findZone.range.hiMax ? 2 : 1 ); } if( m_highlight.active && m_highlight.start != m_highlight.end ) diff --git a/server/TracyView.hpp b/server/TracyView.hpp index fe9bbf7d..478b1fd4 100644 --- a/server/TracyView.hpp +++ b/server/TracyView.hpp @@ -58,8 +58,12 @@ class View struct Range { + void StartFrame() { hiMin = hiMax = false; } + int64_t min, max; bool active = false; + bool hiMin = false; + bool hiMax = false; }; public: