1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

Rewrite ghost zone folding.

This commit is contained in:
Bartosz Taudul
2023-03-23 00:04:12 +01:00
parent c75b62e3d6
commit 527b5f3311
2 changed files with 14 additions and 20 deletions
+1 -2
View File
@@ -29,7 +29,6 @@ bool View::DrawThread( const TimelineContext& ctx, const ThreadData& thread, con
const auto ty = ctx.ty;
const auto ostep = ty + 1;
const auto pxns = ctx.pxns;
const auto nspx = ctx.nspx;
const auto hover = ctx.hover;
const auto yMin = ctx.yMin;
const auto yMax = ctx.yMax;
@@ -446,7 +445,7 @@ void View::DrawZoneList( const TimelineContext& ctx, const std::vector<TimelineD
const auto color = m_vd.dynamicColors == 2 ? 0xFF666666 : MixGhostColor( GetThreadColor( tid, v.depth ), 0x665555 );
const auto rend = v.rend.Val();
const auto px0 = ( ev.start.Val() - m_vd.zvStart ) * pxns;
const auto px1 = ( rend - ev.end.Val() ) * pxns;
const auto px1 = ( rend - m_vd.zvStart ) * pxns;
draw->AddRectFilled( wpos + ImVec2( std::max( px0, -10.0 ), offset ), wpos + ImVec2( std::min( std::max( px1, px0+MinVisSize ), double( w + 10 ) ), offset + ty ), color );
DrawZigZag( draw, wpos + ImVec2( 0, offset + ty/2 ), std::max( px0, -10.0 ), std::min( std::max( px1, px0+MinVisSize ), double( w + 10 ) ), ty/4, DarkenColor( color ) );
if( hover && ImGui::IsMouseHoveringRect( wpos + ImVec2( std::max( px0, -10.0 ), offset ), wpos + ImVec2( std::min( std::max( px1, px0+MinVisSize ), double( w + 10 ) ), offset + ty + 1 ) ) )