mirror of
https://github.com/wolfpld/tracy
synced 2025-04-29 12:23:53 +00:00
Prevent thick zone highlight from going outside the zone box.
This commit is contained in:
parent
5bd3f3de5f
commit
0e930a2c13
@ -237,9 +237,16 @@ int View::DrawGpuZoneLevel( const V& vec, bool hover, double pxns, int64_t nspx,
|
||||
const auto zoneColor = GetZoneColorData( ev );
|
||||
draw->AddRectFilled( wpos + ImVec2( px0, offset ), wpos + ImVec2( px1, offset + tsz.y ), zoneColor.color );
|
||||
if( zoneColor.highlight )
|
||||
{
|
||||
if( zoneColor.thickness > 1.f )
|
||||
{
|
||||
draw->AddRect( wpos + ImVec2( px0 + 1, offset + 1 ), wpos + ImVec2( px1 - 1, offset + tsz.y - 1 ), zoneColor.accentColor, 0.f, -1, zoneColor.thickness );
|
||||
}
|
||||
else
|
||||
{
|
||||
draw->AddRect( wpos + ImVec2( px0, offset ), wpos + ImVec2( px1, offset + tsz.y ), zoneColor.accentColor, 0.f, -1, zoneColor.thickness );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
const auto darkColor = DarkenColor( zoneColor.color );
|
||||
|
@ -733,9 +733,16 @@ int View::DrawZoneLevel( const V& vec, bool hover, double pxns, int64_t nspx, co
|
||||
const auto px1 = std::max( { std::min( pr1, double( w + 10 ) ), px0 + pxns * 0.5, px0 + MinVisSize } );
|
||||
draw->AddRectFilled( wpos + ImVec2( px0, offset ), wpos + ImVec2( px1, offset + tsz.y ), zoneColor.color );
|
||||
if( zoneColor.highlight )
|
||||
{
|
||||
if( zoneColor.thickness > 1.f )
|
||||
{
|
||||
draw->AddRect( wpos + ImVec2( px0 + 1, offset + 1 ), wpos + ImVec2( px1 - 1, offset + tsz.y - 1 ), zoneColor.accentColor, 0.f, -1, zoneColor.thickness );
|
||||
}
|
||||
else
|
||||
{
|
||||
draw->AddRect( wpos + ImVec2( px0, offset ), wpos + ImVec2( px1, offset + tsz.y ), zoneColor.accentColor, 0.f, -1, zoneColor.thickness );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
const auto darkColor = DarkenColor( zoneColor.color );
|
||||
|
Loading…
x
Reference in New Issue
Block a user