From 6a65ceb71a08b2fd2c3b0961d5d26d1b24305d37 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Fri, 16 Feb 2018 16:19:31 +0100 Subject: [PATCH] Display maximum number of counts in bins. --- server/TracyView.cpp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 02da32ea..6afc8aeb 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -4201,16 +4201,7 @@ void View::DrawFindZone() if( dt > 0 ) { - enum { Height = 200 }; const auto w = ImGui::GetContentRegionAvail().x; - const auto wpos = ImGui::GetCursorScreenPos(); - - ImGui::InvisibleButton( "##histogram", ImVec2( w, Height ) ); - const bool hover = ImGui::IsItemHovered(); - - auto draw = ImGui::GetWindowDrawList(); - draw->AddRectFilled( wpos, wpos + ImVec2( w, Height ), 0x22FFFFFF ); - draw->AddRect( wpos, wpos + ImVec2( w, Height ), 0x88FFFFFF ); const auto numBins = int64_t( w - 4 ); if( numBins > 1 ) @@ -4257,6 +4248,18 @@ void View::DrawFindZone() maxVal = std::max( maxVal, bins[i] ); } + ImGui::Text( "Max counts: %s", RealToString( maxVal, true ) ); + + enum { Height = 200 }; + const auto wpos = ImGui::GetCursorScreenPos(); + + ImGui::InvisibleButton( "##histogram", ImVec2( w, Height ) ); + const bool hover = ImGui::IsItemHovered(); + + auto draw = ImGui::GetWindowDrawList(); + draw->AddRectFilled( wpos, wpos + ImVec2( w, Height ), 0x22FFFFFF ); + draw->AddRect( wpos, wpos + ImVec2( w, Height ), 0x88FFFFFF ); + if( m_findZone.logVal ) { const auto hAdj = double( Height - 4 ) / log10( maxVal + 1 );