diff --git a/manual/tracy.tex b/manual/tracy.tex index 9a4cef52..6e4b21dd 100644 --- a/manual/tracy.tex +++ b/manual/tracy.tex @@ -3827,7 +3827,7 @@ The control menu (top row of buttons) provides access to various profiler featur \item \emph{\faImages{}~Frame statistics} -- Display frame statistics window (section~\ref{framestatistics}). \end{itemize} \item \emph{ \faBook{}~User manual} -- Opens the user manual for quick reference. Note that the version of the user manual available directly in the profiler is an inferior quality version compared to the proper PDF. -\item \emph{\faMagnifyingGlassPlus{}~Display scale} -- Enables run-time resizing of the displayed content. This may be useful in environments with potentially reduced visibility, e.g. during a presentation. Note that this setting is independent to the UI scaling coming from the system DPI settings. The scale will be preserved across multiple profiler sessions if the \emph{Save UI scale} option is selected in global settings. +\item \emph{\faMagnifyingGlassPlus{}~Display scale} -- Enables run-time resizing of the displayed content. This may be useful in environments with potentially reduced visibility, e.g. during a presentation. Note that this setting is independent to the UI scaling coming from the system DPI settings. The scale will be preserved across multiple profiler sessions if the \emph{Save UI scale} option is selected in global settings. The user interface scale can also be adjusted with \keys{\ctrl + {+}} and \keys{\ctrl + \textminus}, or reset to 100\% with \keys{\ctrl + 0}. \item \emph{\faRobot{}~Tracy Assist} -- Shows the automated assistant chat window (section~\ref{tracyassist}). Only available if enabled in global settings (section~\ref{aboutwindow}). \end{itemize} diff --git a/profiler/src/profiler/TracyView.cpp b/profiler/src/profiler/TracyView.cpp index 30349dd4..c670aa3a 100644 --- a/profiler/src/profiler/TracyView.cpp +++ b/profiler/src/profiler/TracyView.cpp @@ -169,6 +169,12 @@ void View::SetZoomPreset( int idx ) if( m_sscb ) m_sscb( idx ); } +void View::ZoomUserScale( int dir ) +{ + const int idx = dir == 0 ? s_zoomPreset100 : s_config.zoomLevel + dir; + if( idx >= 0 && idx < s_zoomPresetCount ) SetZoomPreset( idx ); +} + void View::ViewSource( const char* fileName, int line ) { assert( fileName ); @@ -793,6 +799,21 @@ bool View::DrawImpl() m_findZone.show = true; m_shortcut = ShortcutAction::OpenFind; } + if( m_sscb ) + { + if( ImGui::IsKeyPressed( ImGuiKey_Equal, false ) || ImGui::IsKeyPressed( ImGuiKey_KeypadAdd, false ) ) + { + ZoomUserScale( 1 ); + } + else if( ImGui::IsKeyPressed( ImGuiKey_Minus, false ) || ImGui::IsKeyPressed( ImGuiKey_KeypadSubtract, false ) ) + { + ZoomUserScale( -1 ); + } + else if( ImGui::IsKeyPressed( ImGuiKey_0, false ) || ImGui::IsKeyPressed( ImGuiKey_Keypad0, false ) ) + { + ZoomUserScale( 0 ); + } + } } if( !m_frames ) m_frames = m_worker.GetFramesBase(); diff --git a/profiler/src/profiler/TracyView.hpp b/profiler/src/profiler/TracyView.hpp index 7568daa7..c6a2ca63 100644 --- a/profiler/src/profiler/TracyView.hpp +++ b/profiler/src/profiler/TracyView.hpp @@ -305,6 +305,7 @@ private: void Achieve( const char* id ); void SaveUserData(); void SetZoomPreset( int idx ); + void ZoomUserScale( int dir ); bool DrawImpl(); void DrawFrameImage( FrameImageCache& cache, const FrameImage& fi, float scale = GetScale() );