mirror of
https://github.com/wolfpld/tracy.git
synced 2025-03-20 07:40:02 +08:00
Highlight selected zone.
This commit is contained in:
parent
c5f6ca9656
commit
b386e51edc
@ -1188,7 +1188,7 @@ int View::DrawZoneLevel( const Vector<Event*>& vec, bool hover, double pxns, con
|
|||||||
const auto px0 = std::max( pr0, -10.0 );
|
const auto px0 = std::max( pr0, -10.0 );
|
||||||
const auto px1 = std::min( pr1, double( w + 10 ) );
|
const auto px1 = std::min( pr1, double( w + 10 ) );
|
||||||
draw->AddRectFilled( wpos + ImVec2( px0, offset ), wpos + ImVec2( px1, offset + tsz.y ), color, 2.f );
|
draw->AddRectFilled( wpos + ImVec2( px0, offset ), wpos + ImVec2( px1, offset + tsz.y ), color, 2.f );
|
||||||
draw->AddRect( wpos + ImVec2( px0, offset ), wpos + ImVec2( px1, offset + tsz.y ), 0xAAAAAAAA, 2.f );
|
draw->AddRect( wpos + ImVec2( px0, offset ), wpos + ImVec2( px1, offset + tsz.y ), GetZoneHighlight( ev ), 2.f );
|
||||||
if( dsz * dmul >= MinVisSize )
|
if( dsz * dmul >= MinVisSize )
|
||||||
{
|
{
|
||||||
draw->AddRectFilled( wpos + ImVec2( pr0, offset ), wpos + ImVec2( std::min( pr0+dsz*dmul, pr1 ), offset + tsz.y ), 0x882222DD, 2.f );
|
draw->AddRectFilled( wpos + ImVec2( pr0, offset ), wpos + ImVec2( std::min( pr0+dsz*dmul, pr1 ), offset + tsz.y ), 0x882222DD, 2.f );
|
||||||
@ -1285,4 +1285,16 @@ void View::DrawZoneInfoWindow()
|
|||||||
if( !show ) m_zoneInfoWindow = nullptr;
|
if( !show ) m_zoneInfoWindow = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint32_t View::GetZoneHighlight( const Event& ev )
|
||||||
|
{
|
||||||
|
if( m_zoneInfoWindow == &ev )
|
||||||
|
{
|
||||||
|
return 0xFF44DD44;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return 0xAAAAAAAA;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -87,6 +87,8 @@ private:
|
|||||||
int DrawZoneLevel( const Vector<Event*>& vec, bool hover, double pxns, const ImVec2& wpos, int offset, int depth );
|
int DrawZoneLevel( const Vector<Event*>& vec, bool hover, double pxns, const ImVec2& wpos, int offset, int depth );
|
||||||
void DrawZoneInfoWindow();
|
void DrawZoneInfoWindow();
|
||||||
|
|
||||||
|
uint32_t GetZoneHighlight( const Event& ev );
|
||||||
|
|
||||||
std::string m_addr;
|
std::string m_addr;
|
||||||
|
|
||||||
Socket m_sock;
|
Socket m_sock;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user