mirror of
https://github.com/wolfpld/tracy.git
synced 2025-03-20 07:40:02 +08:00
Extract "center view at time" function.
This commit is contained in:
@@ -3375,8 +3375,7 @@ void View::DrawMessages()
|
||||
ImGui::PushID( v );
|
||||
if( ImGui::Selectable( TimeToString( v->time - m_worker.GetFrameBegin( 0 ) ), m_msgHighlight == v, ImGuiSelectableFlags_SpanAllColumns ) )
|
||||
{
|
||||
const auto hr = std::max<uint64_t>( 1, ( m_zvEnd - m_zvStart ) / 2 );
|
||||
ZoomToRange( v->time - hr, v->time + hr );
|
||||
CenterAtTime( v->time );
|
||||
}
|
||||
ImGui::PopID();
|
||||
ImGui::NextColumn();
|
||||
@@ -5577,6 +5576,12 @@ void View::ZoomToNextFrame()
|
||||
ZoomToRange( fbegin, fend );
|
||||
}
|
||||
|
||||
void View::CenterAtTime( int64_t t )
|
||||
{
|
||||
const auto hr = std::max<uint64_t>( 1, ( m_zvEnd - m_zvStart ) / 2 );
|
||||
ZoomToRange( t - hr, t + hr );
|
||||
}
|
||||
|
||||
void View::ShowZoneInfo( const ZoneEvent& ev )
|
||||
{
|
||||
if( m_zoneInfoWindow )
|
||||
|
||||
Reference in New Issue
Block a user