From f5c0f348d77c71f9477caade7c56520d2695f3d4 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Mon, 12 Oct 2026 21:11:28 +0200 Subject: [PATCH] Call a hook when a timeline item header zooms to its range. --- profiler/src/profiler/TracyTimelineItem.cpp | 1 + profiler/src/profiler/TracyTimelineItem.hpp | 1 + 2 files changed, 2 insertions(+) diff --git a/profiler/src/profiler/TracyTimelineItem.cpp b/profiler/src/profiler/TracyTimelineItem.cpp index 1d117c08..080f095c 100644 --- a/profiler/src/profiler/TracyTimelineItem.cpp +++ b/profiler/src/profiler/TracyTimelineItem.cpp @@ -108,6 +108,7 @@ void TimelineItem::Draw( bool firstFrame, const TimelineContext& ctx, int yOffse if( t0 < t1 ) { m_view.ZoomToRange( t0, t1 ); + HeaderZoomed(); } } if( IsMouseClicked( ImGuiMouseButton_Right ) ) diff --git a/profiler/src/profiler/TracyTimelineItem.hpp b/profiler/src/profiler/TracyTimelineItem.hpp index 71297fa3..3e4ef9ce 100644 --- a/profiler/src/profiler/TracyTimelineItem.hpp +++ b/profiler/src/profiler/TracyTimelineItem.hpp @@ -51,6 +51,7 @@ protected: virtual void HeaderTooltip( const char* label ) const {}; virtual void HeaderExtraContents( const TimelineContext& ctx, int offset, float labelWidth ) {}; + virtual void HeaderZoomed() {} virtual int64_t RangeBegin() const = 0; virtual int64_t RangeEnd() const = 0;