mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-22 14:44:34 +00:00
Middle click to zoom to zone.
This commit is contained in:
parent
e076d1d475
commit
8ad7ba1dd0
@ -999,6 +999,8 @@ void View::DrawZones()
|
||||
}
|
||||
while( false );
|
||||
|
||||
m_zvStartNext = 0;
|
||||
|
||||
// zones
|
||||
const auto ostep = ImGui::GetFontSize();
|
||||
int offset = 20;
|
||||
@ -1012,6 +1014,12 @@ void View::DrawZones()
|
||||
|
||||
offset += ostep * ( depth + 1.2f );
|
||||
}
|
||||
|
||||
if( m_zvStartNext != 0 )
|
||||
{
|
||||
m_zvStart = m_zvStartNext;
|
||||
m_zvEnd = m_zvEndNext;
|
||||
}
|
||||
}
|
||||
|
||||
int View::DrawZoneLevel( const Vector<Event*>& vec, bool hover, double pxns, const ImVec2& wpos, int _offset, int depth )
|
||||
@ -1110,6 +1118,12 @@ int View::DrawZoneLevel( const Vector<Event*>& vec, bool hover, double pxns, con
|
||||
ImGui::Text( "Execution time: %s", TimeToString( end - ev.start ) );
|
||||
ImGui::Text( "Without profiling: %s", TimeToString( end - ev.start - m_delay ) );
|
||||
ImGui::EndTooltip();
|
||||
|
||||
if( ImGui::IsMouseDown( 2 ) && ev.end - ev.start > 0 )
|
||||
{
|
||||
m_zvStartNext = ev.start;
|
||||
m_zvEndNext = ev.end;
|
||||
}
|
||||
}
|
||||
|
||||
if( !ev.child.empty() )
|
||||
|
@ -120,6 +120,9 @@ private:
|
||||
int64_t m_zvStart;
|
||||
int64_t m_zvEnd;
|
||||
|
||||
int64_t m_zvStartNext;
|
||||
int64_t m_zvEndNext;
|
||||
|
||||
uint64_t m_delay;
|
||||
double m_timerMul;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user