From 7b2ed41179e2caf575cbfe5f3acaec6ce3e3dd2b Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sat, 20 Nov 2021 14:47:13 +0100 Subject: [PATCH] Push small font to SourceView. --- server/TracySourceView.cpp | 1 + server/TracySourceView.hpp | 3 ++- server/TracyView.cpp | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/server/TracySourceView.cpp b/server/TracySourceView.cpp index c8b2373f..50239e50 100644 --- a/server/TracySourceView.cpp +++ b/server/TracySourceView.cpp @@ -163,6 +163,7 @@ enum { JumpArrowBase = 9 }; SourceView::SourceView( GetWindowCallback gwcb ) : m_font( nullptr ) + , m_smallFont( nullptr ) , m_symAddr( 0 ) , m_targetAddr( 0 ) , m_targetLine( 0 ) diff --git a/server/TracySourceView.hpp b/server/TracySourceView.hpp index 2cb78a4c..fd736eff 100644 --- a/server/TracySourceView.hpp +++ b/server/TracySourceView.hpp @@ -144,7 +144,7 @@ public: SourceView( GetWindowCallback gwcb ); - void UpdateFont( ImFont* font ) { m_font = font; } + void UpdateFont( ImFont* fixed, ImFont* small ) { m_font = fixed; m_smallFont = small; } void SetCpuId( uint32_t cpuid ); void OpenSource( const char* fileName, int line, const View& view, const Worker& worker ); @@ -198,6 +198,7 @@ private: tracy_force_inline void UnsetFont(); ImFont* m_font; + ImFont* m_smallFont; uint64_t m_symAddr; uint64_t m_baseAddr; uint64_t m_targetAddr; diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 000f5d99..9789f35f 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -15277,7 +15277,7 @@ void View::DrawTextEditor() ImGui::SetNextWindowSize( ImVec2( 1800 * scale, 800 * scale ), ImGuiCond_FirstUseEver ); bool show = true; ImGui::Begin( "Source view", &show, ImGuiWindowFlags_NoScrollbar ); - m_sourceView->UpdateFont( m_fixedFont ); + m_sourceView->UpdateFont( m_fixedFont, m_smallFont ); m_sourceView->Render( m_worker, *this ); ImGui::End(); if( !show ) m_sourceViewFile = nullptr;