Add font set/unset helpers.

This commit is contained in:
Bartosz Taudul 2021-11-19 21:06:07 +01:00
parent dd8083e0ee
commit e0a6c51a2f
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3
2 changed files with 14 additions and 0 deletions

View File

@ -4837,4 +4837,14 @@ void SourceView::Save( const Worker& worker, size_t start, size_t stop )
}
#endif
void SourceView::SetFont()
{
if( m_font ) ImGui::PushFont( m_font );
}
void SourceView::UnsetFont()
{
if( m_font ) ImGui::PopFont();
}
}

View File

@ -10,6 +10,7 @@
#include "TracyDecayValue.hpp"
#include "TracySourceContents.hpp"
#include "TracySourceTokenizer.hpp"
#include "../common/TracyForceInline.hpp"
#include "../common/TracyProtocol.hpp"
struct ImFont;
@ -193,6 +194,9 @@ private:
void Save( const Worker& worker, size_t start = 0, size_t stop = std::numeric_limits<size_t>::max() );
#endif
tracy_force_inline void SetFont();
tracy_force_inline void UnsetFont();
ImFont* m_font;
uint64_t m_symAddr;
uint64_t m_baseAddr;