mirror of
https://github.com/wolfpld/tracy
synced 2025-05-09 00:13:52 +00:00
Display proper tooltip when only 1 zone is too small to display.
This commit is contained in:
parent
bb59eafda4
commit
2ca28b779a
@ -2140,6 +2140,8 @@ int View::DrawZoneLevel( const Vector<ZoneEvent*>& vec, bool hover, double pxns,
|
|||||||
}
|
}
|
||||||
draw->AddRectFilled( wpos + ImVec2( std::max( px0, -10.0 ), offset ), wpos + ImVec2( std::min( std::max( px1, px0+MinVisSize ), double( w + 10 ) ), offset + ty ), color );
|
draw->AddRectFilled( wpos + ImVec2( std::max( px0, -10.0 ), offset ), wpos + ImVec2( std::min( std::max( px1, px0+MinVisSize ), double( w + 10 ) ), offset + ty ), color );
|
||||||
if( hover && ImGui::IsMouseHoveringRect( wpos + ImVec2( std::max( px0, -10.0 ), offset ), wpos + ImVec2( std::min( std::max( px1, px0+MinVisSize ), double( w + 10 ) ), offset + ty ) ) )
|
if( hover && ImGui::IsMouseHoveringRect( wpos + ImVec2( std::max( px0, -10.0 ), offset ), wpos + ImVec2( std::min( std::max( px1, px0+MinVisSize ), double( w + 10 ) ), offset + ty ) ) )
|
||||||
|
{
|
||||||
|
if( num > 1 )
|
||||||
{
|
{
|
||||||
ImGui::BeginTooltip();
|
ImGui::BeginTooltip();
|
||||||
ImGui::Text( "Zones too small to display: %i", num );
|
ImGui::Text( "Zones too small to display: %i", num );
|
||||||
@ -2152,6 +2154,20 @@ int View::DrawZoneLevel( const Vector<ZoneEvent*>& vec, bool hover, double pxns,
|
|||||||
m_zvEndNext = rend;
|
m_zvEndNext = rend;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ZoneTooltip( ev );
|
||||||
|
|
||||||
|
if( ImGui::IsMouseClicked( 2 ) && rend - ev.start > 0 )
|
||||||
|
{
|
||||||
|
ZoomToZone( ev );
|
||||||
|
}
|
||||||
|
if( ImGui::IsMouseClicked( 0 ) )
|
||||||
|
{
|
||||||
|
m_zoneInfoWindow = &ev;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
char tmp[32];
|
char tmp[32];
|
||||||
sprintf( tmp, "%i", num );
|
sprintf( tmp, "%i", num );
|
||||||
const auto tsz = ImGui::CalcTextSize( tmp );
|
const auto tsz = ImGui::CalcTextSize( tmp );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user