mirror of
https://github.com/wolfpld/tracy.git
synced 2025-03-20 07:40:02 +08:00
Display maximum number of counts in bins.
This commit is contained in:
parent
4611bc355f
commit
6a65ceb71a
@ -4201,16 +4201,7 @@ void View::DrawFindZone()
|
|||||||
|
|
||||||
if( dt > 0 )
|
if( dt > 0 )
|
||||||
{
|
{
|
||||||
enum { Height = 200 };
|
|
||||||
const auto w = ImGui::GetContentRegionAvail().x;
|
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 );
|
const auto numBins = int64_t( w - 4 );
|
||||||
if( numBins > 1 )
|
if( numBins > 1 )
|
||||||
@ -4257,6 +4248,18 @@ void View::DrawFindZone()
|
|||||||
maxVal = std::max( maxVal, bins[i] );
|
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 )
|
if( m_findZone.logVal )
|
||||||
{
|
{
|
||||||
const auto hAdj = double( Height - 4 ) / log10( maxVal + 1 );
|
const auto hAdj = double( Height - 4 ) / log10( maxVal + 1 );
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user