From 55ea2a20e761f7ba3ee318bcdbc6035b168bba6d Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sun, 27 Oct 2024 19:59:48 +0100 Subject: [PATCH] Set minimum size for folded flame graph items. --- profiler/src/profiler/TracyView_FlameGraph.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/profiler/src/profiler/TracyView_FlameGraph.cpp b/profiler/src/profiler/TracyView_FlameGraph.cpp index 39053b7d..4d7dd0dc 100644 --- a/profiler/src/profiler/TracyView_FlameGraph.cpp +++ b/profiler/src/profiler/TracyView_FlameGraph.cpp @@ -300,8 +300,8 @@ void View::DrawFlameGraphLevel( const std::vector& data, FlameGr } const auto px0 = ( it->begin - vStart ) * pxns; const auto px1 = ( (next-1)->begin + (next-1)->time - vStart ) * pxns; - draw->AddRectFilled( ImVec2( wpos.x + px0, wpos.y + depth * ostep ), ImVec2( wpos.x + px1, wpos.y + ( depth + 1 ) * ostep ), 0xFF666666 ); - DrawZigZag( draw, ImVec2( wpos.x, wpos.y + ( depth + 0.5f ) * ostep ), px0, px1, ctx.ty / 4, 0xFF444444 ); + draw->AddRectFilled( ImVec2( wpos.x + px0, wpos.y + depth * ostep ), ImVec2( wpos.x + std::max( px1, px0 + MinVisSize ), wpos.y + ( depth + 1 ) * ostep ), 0xFF666666 ); + DrawZigZag( draw, ImVec2( wpos.x, wpos.y + ( depth + 0.5f ) * ostep ), px0, std::max( px1, px0 + MinVisSize ), ctx.ty / 4, 0xFF444444 ); it = next; } else