mirror of
https://github.com/wolfpld/tracy
synced 2025-04-30 12:53:51 +00:00
Add range boundary highlight.
This commit is contained in:
parent
ff5daf9df7
commit
2f5f2e5b1d
@ -2294,6 +2294,7 @@ void View::DrawZones()
|
|||||||
m_cpuDataThread.Decay( 0 );
|
m_cpuDataThread.Decay( 0 );
|
||||||
m_zoneHover = nullptr;
|
m_zoneHover = nullptr;
|
||||||
m_zoneHover2.Decay( nullptr );
|
m_zoneHover2.Decay( nullptr );
|
||||||
|
m_findZone.range.StartFrame();
|
||||||
|
|
||||||
if( m_vd.zvStart == m_vd.zvEnd ) return;
|
if( m_vd.zvStart == m_vd.zvEnd ) return;
|
||||||
assert( m_vd.zvStart < m_vd.zvEnd );
|
assert( m_vd.zvStart < m_vd.zvEnd );
|
||||||
@ -3075,7 +3076,8 @@ void View::DrawZones()
|
|||||||
const auto px0 = ( m_findZone.range.min - m_vd.zvStart ) * pxns;
|
const auto px0 = ( m_findZone.range.min - m_vd.zvStart ) * pxns;
|
||||||
const auto px1 = std::max( px0 + std::max( 1.0, pxns * 0.5 ), ( m_findZone.range.max - m_vd.zvStart ) * pxns );
|
const auto px1 = std::max( px0 + std::max( 1.0, pxns * 0.5 ), ( m_findZone.range.max - m_vd.zvStart ) * pxns );
|
||||||
DrawStripedRect( draw, wpos.x + px0, linepos.y, wpos.x + px1, linepos.y + lineh, 10 * ImGui::GetTextLineHeight() / 15.f, 0x2288DDDD );
|
DrawStripedRect( draw, wpos.x + px0, linepos.y, wpos.x + px1, linepos.y + lineh, 10 * ImGui::GetTextLineHeight() / 15.f, 0x2288DDDD );
|
||||||
draw->AddRect( ImVec2( wpos.x + px0, linepos.y ), ImVec2( wpos.x + px1, linepos.y + lineh ), 0x3388DDDD );
|
draw->AddLine( ImVec2( wpos.x + px0, linepos.y ), ImVec2( wpos.x + px0, linepos.y + lineh ), m_findZone.range.hiMin ? 0x9988DDDD : 0x3388DDDD, m_findZone.range.hiMin ? 2 : 1 );
|
||||||
|
draw->AddLine( ImVec2( wpos.x + px1, linepos.y ), ImVec2( wpos.x + px1, linepos.y + lineh ), m_findZone.range.hiMax ? 0x9988DDDD : 0x3388DDDD, m_findZone.range.hiMax ? 2 : 1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( m_highlight.active && m_highlight.start != m_highlight.end )
|
if( m_highlight.active && m_highlight.start != m_highlight.end )
|
||||||
|
@ -58,8 +58,12 @@ class View
|
|||||||
|
|
||||||
struct Range
|
struct Range
|
||||||
{
|
{
|
||||||
|
void StartFrame() { hiMin = hiMax = false; }
|
||||||
|
|
||||||
int64_t min, max;
|
int64_t min, max;
|
||||||
bool active = false;
|
bool active = false;
|
||||||
|
bool hiMin = false;
|
||||||
|
bool hiMax = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user