mirror of
https://github.com/wolfpld/tracy
synced 2025-05-08 16:03:53 +00:00
Display proper tooltip when only 1 zone is too small to display.
This commit is contained in:
parent
bb59eafda4
commit
2ca28b779a
@ -2141,15 +2141,31 @@ 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 ) ) )
|
||||||
{
|
{
|
||||||
ImGui::BeginTooltip();
|
if( num > 1 )
|
||||||
ImGui::Text( "Zones too small to display: %i", num );
|
|
||||||
ImGui::Text( "Execution time: %s", TimeToString( rend - ev.start ) );
|
|
||||||
ImGui::EndTooltip();
|
|
||||||
|
|
||||||
if( ImGui::IsMouseClicked( 2 ) && rend - ev.start > 0 )
|
|
||||||
{
|
{
|
||||||
m_zvStartNext = ev.start;
|
ImGui::BeginTooltip();
|
||||||
m_zvEndNext = rend;
|
ImGui::Text( "Zones too small to display: %i", num );
|
||||||
|
ImGui::Text( "Execution time: %s", TimeToString( rend - ev.start ) );
|
||||||
|
ImGui::EndTooltip();
|
||||||
|
|
||||||
|
if( ImGui::IsMouseClicked( 2 ) && rend - ev.start > 0 )
|
||||||
|
{
|
||||||
|
m_zvStartNext = ev.start;
|
||||||
|
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];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user