diff --git a/server/TracyTimelineContext.hpp b/server/TracyTimelineContext.hpp index 4878eb81..1b5fa4d1 100644 --- a/server/TracyTimelineContext.hpp +++ b/server/TracyTimelineContext.hpp @@ -10,7 +10,7 @@ namespace tracy struct TimelineContext { - float w, ty, scale; + float w, ty, sty, scale; float yMin, yMax; double pxns, nspx; int64_t vStart, vEnd; diff --git a/server/TracyTimelineController.cpp b/server/TracyTimelineController.cpp index 848548b5..de2947d8 100644 --- a/server/TracyTimelineController.cpp +++ b/server/TracyTimelineController.cpp @@ -97,7 +97,7 @@ std::optional TimelineController::CalculateScrollPosition() const return std::nullopt; } -void TimelineController::End( double pxns, const ImVec2& wpos, bool hover, bool vcenter, float yMin, float yMax ) +void TimelineController::End( double pxns, const ImVec2& wpos, bool hover, bool vcenter, float yMin, float yMax, ImFont* smallFont ) { auto shouldUpdateCenterItem = [&] () { const auto imguiChangedScroll = m_scroll != ImGui::GetScrollY(); @@ -123,6 +123,9 @@ void TimelineController::End( double pxns, const ImVec2& wpos, bool hover, bool TimelineContext ctx; ctx.w = ImGui::GetContentRegionAvail().x - 1; ctx.ty = ImGui::GetTextLineHeight(); + ImGui::PushFont( smallFont ); + ctx.sty = ImGui::GetTextLineHeight(); + ImGui::PopFont(); ctx.scale = GetScale(); ctx.yMin = yMin; ctx.yMax = yMax; diff --git a/server/TracyTimelineController.hpp b/server/TracyTimelineController.hpp index d63abc60..35258f2f 100644 --- a/server/TracyTimelineController.hpp +++ b/server/TracyTimelineController.hpp @@ -25,7 +25,7 @@ public: void FirstFrameExpired(); void Begin(); - void End( double pxns, const ImVec2& wpos, bool hover, bool vcenter, float yMin, float yMax ); + void End( double pxns, const ImVec2& wpos, bool hover, bool vcenter, float yMin, float yMax, ImFont* smallFont ); template void AddItem( U* data ) diff --git a/server/TracyView_Timeline.cpp b/server/TracyView_Timeline.cpp index ed64826f..c7dff5d0 100644 --- a/server/TracyView_Timeline.cpp +++ b/server/TracyView_Timeline.cpp @@ -385,7 +385,7 @@ void View::DrawTimeline() } const auto vcenter = verticallyCenterTimeline && drawMouseLine && m_viewMode == ViewMode::Paused; - m_tc.End( pxns, wpos, hover, vcenter, yMin, yMax ); + m_tc.End( pxns, wpos, hover, vcenter, yMin, yMax, m_smallFont ); ImGui::EndChild(); m_lockHighlight = m_nextLockHighlight;