diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 90eaef26..ad32cb9d 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -6246,22 +6246,6 @@ void View::DrawFindZone() const auto numBins = int64_t( w - 4 ); if( numBins > 1 ) { - if( numBins > m_findZone.numBins ) - { - m_findZone.numBins = numBins; - m_findZone.bins = std::make_unique( numBins ); - m_findZone.binTime = std::make_unique( numBins ); - m_findZone.selBin = std::make_unique( numBins ); - } - - const auto& bins = m_findZone.bins; - const auto& binTime = m_findZone.binTime; - const auto& selBin = m_findZone.selBin; - - memset( bins.get(), 0, sizeof( int64_t ) * numBins ); - memset( binTime.get(), 0, sizeof( int64_t ) * numBins ); - memset( selBin.get(), 0, sizeof( int64_t ) * numBins ); - int64_t selectionTime = 0; const auto s = std::min( m_findZone.highlight.start, m_findZone.highlight.end ); const auto e = std::max( m_findZone.highlight.start, m_findZone.highlight.end ); @@ -6323,6 +6307,22 @@ void View::DrawFindZone() timeTotal = tmax - tmin; } + if( numBins > m_findZone.numBins ) + { + m_findZone.numBins = numBins; + m_findZone.bins = std::make_unique( numBins ); + m_findZone.binTime = std::make_unique( numBins ); + m_findZone.selBin = std::make_unique( numBins ); + } + + const auto& bins = m_findZone.bins; + const auto& binTime = m_findZone.binTime; + const auto& selBin = m_findZone.selBin; + + memset( bins.get(), 0, sizeof( int64_t ) * numBins ); + memset( binTime.get(), 0, sizeof( int64_t ) * numBins ); + memset( selBin.get(), 0, sizeof( int64_t ) * numBins ); + if( m_findZone.logTime ) { const auto tMinLog = log10( tmin );