From b4893fafb7a684658e8bdb5d6a9945854f3ebb9b Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sun, 19 Mar 2023 16:07:47 +0100 Subject: [PATCH] Notify TimelineItem when drawing has finished. --- server/TracyTimelineItem.cpp | 2 ++ server/TracyTimelineItem.hpp | 1 + 2 files changed, 3 insertions(+) diff --git a/server/TracyTimelineItem.cpp b/server/TracyTimelineItem.cpp index d4b737e1..e52625ab 100644 --- a/server/TracyTimelineItem.cpp +++ b/server/TracyTimelineItem.cpp @@ -48,6 +48,7 @@ void TimelineItem::Draw( bool firstFrame, const TimelineContext& ctx, int yOffse { if( !DrawContents( ctx, yEnd ) && !m_view.GetViewData().drawEmptyLabels ) { + DrawFinished(); yEnd = yBegin; AdjustThreadHeight( firstFrame, yBegin, yEnd ); ImGui::PopClipRect(); @@ -57,6 +58,7 @@ void TimelineItem::Draw( bool firstFrame, const TimelineContext& ctx, int yOffse } DrawOverlay( wpos + ImVec2( 0, yBegin ), wpos + ImVec2( w, yEnd ) ); + DrawFinished(); ImGui::PopClipRect(); float labelWidth; diff --git a/server/TracyTimelineItem.hpp b/server/TracyTimelineItem.hpp index c6f9b6e7..d7182eea 100644 --- a/server/TracyTimelineItem.hpp +++ b/server/TracyTimelineItem.hpp @@ -50,6 +50,7 @@ protected: virtual bool DrawContents( const TimelineContext& ctx, int& offset ) = 0; virtual void DrawOverlay( const ImVec2& ul, const ImVec2& dr ) {} + virtual void DrawFinished() {} virtual bool IsEmpty() const { return false; }