mirror of
https://github.com/wolfpld/tracy.git
synced 2024-12-02 09:44:35 +00:00
Use one common function for zooming to range.
This commit is contained in:
parent
2f667e11ed
commit
ba80b0c16a
@ -2050,8 +2050,7 @@ bool View::DrawZoneFrames()
|
|||||||
|
|
||||||
if( ImGui::IsMouseClicked( 2 ) )
|
if( ImGui::IsMouseClicked( 2 ) )
|
||||||
{
|
{
|
||||||
m_zvStartNext = fbegin;
|
ZoomToRange( fbegin, fend );
|
||||||
m_zvEndNext = fend;
|
|
||||||
m_pause = true;
|
m_pause = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2422,8 +2421,7 @@ int View::DrawZoneLevel( const Vector<ZoneEvent*>& vec, bool hover, double pxns,
|
|||||||
|
|
||||||
if( ImGui::IsMouseClicked( 2 ) && rend - ev.start > 0 )
|
if( ImGui::IsMouseClicked( 2 ) && rend - ev.start > 0 )
|
||||||
{
|
{
|
||||||
m_zvStartNext = ev.start;
|
ZoomToRange( ev.start, rend );
|
||||||
m_zvEndNext = rend;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -2618,8 +2616,7 @@ int View::DrawGpuZoneLevel( const Vector<GpuEvent*>& vec, bool hover, double pxn
|
|||||||
|
|
||||||
if( ImGui::IsMouseClicked( 2 ) && rend - ev.gpuStart > 0 )
|
if( ImGui::IsMouseClicked( 2 ) && rend - ev.gpuStart > 0 )
|
||||||
{
|
{
|
||||||
m_zvStartNext = ev.gpuStart;
|
ZoomToRange( ev.gpuStart, rend );
|
||||||
m_zvEndNext = rend;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -3631,8 +3628,7 @@ void View::DrawMessages()
|
|||||||
{
|
{
|
||||||
m_pause = true;
|
m_pause = true;
|
||||||
const auto hr = std::max<uint64_t>( 1, ( m_zvEnd - m_zvStart ) / 2 );
|
const auto hr = std::max<uint64_t>( 1, ( m_zvEnd - m_zvStart ) / 2 );
|
||||||
m_zvStart = v->time - hr;
|
ZoomToRange( v->time - hr, v->time + hr );
|
||||||
m_zvEnd = v->time + hr;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ImGui::End();
|
ImGui::End();
|
||||||
@ -3724,15 +3720,19 @@ void View::ZoomToZone( const ZoneEvent& ev )
|
|||||||
{
|
{
|
||||||
const auto end = GetZoneEnd( ev );
|
const auto end = GetZoneEnd( ev );
|
||||||
if( end - ev.start <= 0 ) return;
|
if( end - ev.start <= 0 ) return;
|
||||||
m_zvStartNext = ev.start;
|
ZoomToRange( ev.start, end );
|
||||||
m_zvEndNext = end;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void View::ZoomToZone( const GpuEvent& ev )
|
void View::ZoomToZone( const GpuEvent& ev )
|
||||||
{
|
{
|
||||||
const auto end = GetZoneEnd( ev );
|
const auto end = GetZoneEnd( ev );
|
||||||
if( end - ev.gpuStart <= 0 ) return;
|
if( end - ev.gpuStart <= 0 ) return;
|
||||||
m_zvStartNext = ev.gpuStart;
|
ZoomToRange( ev.gpuStart, end );
|
||||||
|
}
|
||||||
|
|
||||||
|
void View::ZoomToRange( int64_t start, int64_t end )
|
||||||
|
{
|
||||||
|
m_zvStartNext = start;
|
||||||
m_zvEndNext = end;
|
m_zvEndNext = end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -154,6 +154,8 @@ private:
|
|||||||
|
|
||||||
void ZoomToZone( const ZoneEvent& ev );
|
void ZoomToZone( const ZoneEvent& ev );
|
||||||
void ZoomToZone( const GpuEvent& ev );
|
void ZoomToZone( const GpuEvent& ev );
|
||||||
|
void ZoomToRange( int64_t start, int64_t end );
|
||||||
|
|
||||||
void ZoneTooltip( const ZoneEvent& ev );
|
void ZoneTooltip( const ZoneEvent& ev );
|
||||||
void ZoneTooltip( const GpuEvent& ev );
|
void ZoneTooltip( const GpuEvent& ev );
|
||||||
const ZoneEvent* GetZoneParent( const ZoneEvent& zone ) const;
|
const ZoneEvent* GetZoneParent( const ZoneEvent& zone ) const;
|
||||||
|
Loading…
Reference in New Issue
Block a user