mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-23 06:44:35 +00:00
Add hovered frame markers on histogram.
This commit is contained in:
parent
099933e66d
commit
f27cead040
@ -924,6 +924,9 @@ bool View::DrawImpl()
|
||||
ImGui::SameLine();
|
||||
TextDisabledUnformatted( m_notificationText.c_str() );
|
||||
}
|
||||
|
||||
m_frameHover = -1;
|
||||
|
||||
DrawFrames();
|
||||
DrawZones();
|
||||
ImGui::End();
|
||||
@ -1225,6 +1228,7 @@ void View::DrawFrames()
|
||||
}
|
||||
else
|
||||
{
|
||||
m_frameHover = sel;
|
||||
if( m_frames->name == 0 )
|
||||
{
|
||||
const auto offset = m_worker.GetFrameOffset();
|
||||
@ -1694,6 +1698,8 @@ bool View::DrawZoneFrames( const FrameData& frames )
|
||||
{
|
||||
ZoomToRange( fbegin, fend );
|
||||
}
|
||||
|
||||
if( activeFrameSet ) m_frameHover = i;
|
||||
}
|
||||
|
||||
if( fsz < MinFrameSize )
|
||||
@ -8942,6 +8948,23 @@ void View::DrawInfo()
|
||||
TextFocused( "Count:", RealToString( bins[bin], true ) );
|
||||
ImGui::EndTooltip();
|
||||
}
|
||||
|
||||
if( m_frameHover != -1 )
|
||||
{
|
||||
const auto frameTime = m_worker.GetFrameTime( *m_frames, m_frameHover );
|
||||
float framePos;
|
||||
if( m_frameSortData.logTime )
|
||||
{
|
||||
const auto ltmin = log10( tmin );
|
||||
const auto ltmax = log10( tmax );
|
||||
framePos = round( ( log10( frameTime ) - ltmin ) / float( ltmax - ltmin ) * numBins );
|
||||
}
|
||||
else
|
||||
{
|
||||
framePos = round( ( frameTime - tmin ) / float( tmax - tmin ) * numBins );
|
||||
}
|
||||
draw->AddLine( ImVec2( wpos.x + framePos, wpos.y ), ImVec2( wpos.x + framePos, wpos.y+Height-2 ), 0xFFFFFFFF );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -264,6 +264,7 @@ private:
|
||||
const FrameData* m_frames;
|
||||
uint32_t m_lockInfoWindow = InvalidId;
|
||||
ZoneEvent* m_zoneHover = nullptr;
|
||||
int m_frameHover = -1;
|
||||
|
||||
Region m_highlight;
|
||||
Region m_highlightZoom;
|
||||
|
Loading…
Reference in New Issue
Block a user