From 854210a7e31f5b455937631d387a76a094b09f89 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sun, 2 Sep 2018 02:09:29 +0200 Subject: [PATCH] Fix find zone histogram selection start/end. --- server/TracyView.cpp | 13 ++++++++++++- server/TracyView.hpp | 1 + 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index cc341446..696223a8 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -5017,10 +5017,21 @@ void View::DrawFindZone() m_findZone.highlight.active = true; m_findZone.highlight.start = t0; m_findZone.highlight.end = t1; + m_findZone.hlOrig_t0 = t0; + m_findZone.hlOrig_t1 = t1; } else if( ImGui::IsMouseDragging( 0, 0 ) ) { - m_findZone.highlight.end = t1 > m_findZone.highlight.start ? t1 : t0; + if( t0 < m_findZone.hlOrig_t0 ) + { + m_findZone.highlight.start = t0; + m_findZone.highlight.end = m_findZone.hlOrig_t1; + } + else + { + m_findZone.highlight.start = m_findZone.hlOrig_t0; + m_findZone.highlight.end = t1; + } m_findZone.ResetGroups(); } } diff --git a/server/TracyView.hpp b/server/TracyView.hpp index 99443f61..d3791a3e 100644 --- a/server/TracyView.hpp +++ b/server/TracyView.hpp @@ -289,6 +289,7 @@ private: GroupBy groupBy = GroupBy::Thread; SortBy sortBy = SortBy::Order; Region highlight; + int64_t hlOrig_t0, hlOrig_t1; int64_t numBins = -1; std::unique_ptr bins, binTime, selBin; std::vector sorted;