Make zone highlight more visible.

This commit is contained in:
Bartosz Taudul 2017-09-30 13:45:02 +02:00
parent 077585ba4d
commit d7bd8885fe
2 changed files with 14 additions and 1 deletions

View File

@ -1191,7 +1191,7 @@ int View::DrawZoneLevel( const Vector<Event*>& vec, bool hover, double pxns, con
const auto px0 = std::max( pr0, -10.0 );
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->AddRect( wpos + ImVec2( px0, offset ), wpos + ImVec2( px1, offset + tsz.y ), GetZoneHighlight( ev ), 2.f );
draw->AddRect( wpos + ImVec2( px0, offset ), wpos + ImVec2( px1, offset + tsz.y ), GetZoneHighlight( ev ), 2.f, -1, GetZoneThickness( ev ) );
if( dsz * dmul >= MinVisSize )
{
draw->AddRectFilled( wpos + ImVec2( pr0, offset ), wpos + ImVec2( std::min( pr0+dsz*dmul, pr1 ), offset + tsz.y ), 0x882222DD, 2.f );
@ -1382,6 +1382,18 @@ uint32_t View::GetZoneHighlight( const Event& ev )
}
}
float View::GetZoneThickness( const Event& ev )
{
if( m_zoneInfoWindow == &ev || m_zoneHighlight == &ev )
{
return 3.f;
}
else
{
return 1.f;
}
}
void View::ZoomToZone( const Event& ev )
{
if( ev.end - ev.start <= 0 ) return;

View File

@ -88,6 +88,7 @@ private:
void DrawZoneInfoWindow();
uint32_t GetZoneHighlight( const Event& ev );
float GetZoneThickness( const Event& ev );
void ZoomToZone( const Event& ev );
void ZoneTooltip( const Event& ev );