Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/wolfpld/tracy.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authorBartosz Taudul <wolf@nereid.pl>2022-09-09 01:18:40 +0300
committerBartosz Taudul <wolf@nereid.pl>2022-09-09 01:18:40 +0300
commit0e930a2c13a4cc6ec06cd6cd5a170d42a777c67c (patch)
treeed9027cfe9cb638b478d349ead6ab8dec17d28f6 /server
parent5bd3f3de5fa851ae267f8b0d4099c20411d96640 (diff)
Prevent thick zone highlight from going outside the zone box.
Diffstat (limited to 'server')
-rw-r--r--server/TracyView_GpuTimeline.cpp9
-rw-r--r--server/TracyView_ZoneTimeline.cpp9
2 files changed, 16 insertions, 2 deletions
diff --git a/server/TracyView_GpuTimeline.cpp b/server/TracyView_GpuTimeline.cpp
index 677a0174..f255874c 100644
--- a/server/TracyView_GpuTimeline.cpp
+++ b/server/TracyView_GpuTimeline.cpp
@@ -238,7 +238,14 @@ int View::DrawGpuZoneLevel( const V& vec, bool hover, double pxns, int64_t nspx,
draw->AddRectFilled( wpos + ImVec2( px0, offset ), wpos + ImVec2( px1, offset + tsz.y ), zoneColor.color );
if( zoneColor.highlight )
{
- draw->AddRect( wpos + ImVec2( px0, offset ), wpos + ImVec2( px1, offset + tsz.y ), zoneColor.accentColor, 0.f, -1, zoneColor.thickness );
+ 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
{
diff --git a/server/TracyView_ZoneTimeline.cpp b/server/TracyView_ZoneTimeline.cpp
index ec08fe99..92aeded7 100644
--- a/server/TracyView_ZoneTimeline.cpp
+++ b/server/TracyView_ZoneTimeline.cpp
@@ -734,7 +734,14 @@ int View::DrawZoneLevel( const V& vec, bool hover, double pxns, int64_t nspx, co
draw->AddRectFilled( wpos + ImVec2( px0, offset ), wpos + ImVec2( px1, offset + tsz.y ), zoneColor.color );
if( zoneColor.highlight )
{
- draw->AddRect( wpos + ImVec2( px0, offset ), wpos + ImVec2( px1, offset + tsz.y ), zoneColor.accentColor, 0.f, -1, zoneColor.thickness );
+ 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
{