mirror of
https://github.com/wolfpld/tracy.git
synced 2025-03-20 07:40:02 +08:00
Support logarithmic scaling of values on search histogram.
This commit is contained in:
parent
508b699252
commit
9678cc8afc
@ -4190,6 +4190,8 @@ void View::DrawFindZone()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ImGui::Checkbox( "Log values", &m_findZone.logVal );
|
||||||
|
|
||||||
ImGui::Text( "tMin: %s", TimeToString( tmin ) );
|
ImGui::Text( "tMin: %s", TimeToString( tmin ) );
|
||||||
ImGui::Text( "tMax: %s", TimeToString( tmax ) );
|
ImGui::Text( "tMax: %s", TimeToString( tmax ) );
|
||||||
|
|
||||||
@ -4231,13 +4233,27 @@ void View::DrawFindZone()
|
|||||||
maxVal = std::max( maxVal, bins[i] );
|
maxVal = std::max( maxVal, bins[i] );
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto hAdj = double( Height - 4 ) / maxVal;
|
if( m_findZone.logVal )
|
||||||
|
|
||||||
for( int i=0; i<numBins; i++ )
|
|
||||||
{
|
{
|
||||||
if( bins[i] > 0 )
|
const auto hAdj = double( Height - 4 ) / log10( maxVal + 1 );
|
||||||
|
for( int i=0; i<numBins; i++ )
|
||||||
{
|
{
|
||||||
draw->AddLine( wpos + ImVec2( 2+i, Height-3 ), wpos + ImVec2( 2+i, Height-3 - bins[i] * hAdj ), 0xFF22DDDD );
|
if( bins[i] > 0 )
|
||||||
|
{
|
||||||
|
draw->AddLine( wpos + ImVec2( 2+i, Height-3 ), wpos + ImVec2( 2+i, Height-3 - log10( bins[i] + 1 ) * hAdj ), 0xFF22DDDD );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
const auto hAdj = double( Height - 4 ) / maxVal;
|
||||||
|
for( int i=0; i<numBins; i++ )
|
||||||
|
{
|
||||||
|
if( bins[i] > 0 )
|
||||||
|
{
|
||||||
|
draw->AddLine( wpos + ImVec2( 2+i, Height-3 ), wpos + ImVec2( 2+i, Height-3 - bins[i] * hAdj ), 0xFF22DDDD );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -288,6 +288,7 @@ private:
|
|||||||
char pattern[1024] = { "" };
|
char pattern[1024] = { "" };
|
||||||
int maxZonesPerThread = 1000;
|
int maxZonesPerThread = 1000;
|
||||||
int maxDepth = 10;
|
int maxDepth = 10;
|
||||||
|
bool logVal = false;
|
||||||
} m_findZone;
|
} m_findZone;
|
||||||
|
|
||||||
bool m_terminate;
|
bool m_terminate;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user