1
0
mirror of https://github.com/wolfpld/tracy synced 2025-04-29 12:23:53 +00:00

Add left/right counts to histogram tooltip

This commit is contained in:
Cody Tapscott 2023-01-06 21:37:23 -07:00
parent f90336a12f
commit cabfe25333

View File

@ -1249,15 +1249,19 @@ void View::DrawFindZone()
}
int64_t tBefore = 0;
int64_t cntBefore = 0;
for( int i=0; i<bin; i++ )
{
tBefore += binTime[i];
cntBefore += bins[i];
}
int64_t tAfter = 0;
int64_t cntAfter = 0;
for( int i=bin+1; i<numBins; i++ )
{
tAfter += binTime[i];
cntAfter += bins[i];
}
ImGui::BeginTooltip();
@ -1265,6 +1269,8 @@ void View::DrawFindZone()
ImGui::SameLine();
ImGui::Text( "%s - %s", TimeToString( t0 ), TimeToString( t1 ) );
TextFocused( "Count:", RealToString( bins[bin] ) );
TextFocused( "Count in the left bins:", RealToString( cntBefore ) );
TextFocused( "Count in the right bins:", RealToString( cntAfter ) );
TextFocused( "Time spent in bin:", TimeToString( binTime[bin] ) );
TextFocused( "Time spent in the left bins:", TimeToString( tBefore ) );
TextFocused( "Time spent in the right bins:", TimeToString( tAfter ) );