diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 495e8500..277adfae 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -6267,17 +6267,20 @@ void View::DrawFindZone() const auto& sorted = m_findZone.sorted; + auto sortedBegin = sorted.begin(); + auto sortedEnd = sorted.end(); + while( sortedBegin != sortedEnd && *sortedBegin == 0 ) ++sortedBegin; + if( m_findZone.logTime ) { const auto tMinLog = log10( tmin ); const auto zmax = ( log10( tmax ) - tMinLog ) / numBins; { - auto zit = sorted.begin(); - while( zit != sorted.end() && *zit == 0 ) ++zit; + auto zit = sortedBegin; for( int64_t i=0; i= s && *(sorted.end()-1) <= e ) selectionTime += timeSum; + if( m_findZone.highlight.active && *zit >= s && *(sortedEnd-1) <= e ) selectionTime += timeSum; } if( m_findZone.selGroup != m_findZone.Unselected ) @@ -6318,12 +6321,11 @@ void View::DrawFindZone() else { const auto zmax = tmax - tmin; - auto zit = sorted.begin(); - while( zit != sorted.end() && *zit == 0 ) ++zit; + auto zit = sortedBegin; for( int64_t i=0; i= s && *(sorted.end()-1) <= e ) selectionTime += timeSum; + if( m_findZone.highlight.active && *zit >= s && *(sortedEnd-1) <= e ) selectionTime += timeSum; if( m_findZone.selGroup != m_findZone.Unselected ) {