Display maximum number of counts in bins.

This commit is contained in:
Bartosz Taudul 2018-02-16 16:19:31 +01:00
parent 4611bc355f
commit 6a65ceb71a

View File

@ -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 );