Middle click to zoom to zone.

This commit is contained in:
Bartosz Taudul 2017-09-26 21:49:50 +02:00
parent e076d1d475
commit 8ad7ba1dd0
2 changed files with 17 additions and 0 deletions

View File

@ -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() )

View File

@ -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;
};