From 5da2076214668a3201a618475c2fec82886ff9e4 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Fri, 19 Jul 2019 00:51:52 +0200 Subject: [PATCH] Add optional 2x zoom to frame images playback. --- server/TracyView.cpp | 22 +++++++++++++++++++--- server/TracyView.hpp | 1 + 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 1fb0cc8a..f57b0e37 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -9241,13 +9241,27 @@ void View::DrawPlayback() } ImGui::Begin( "Playback", &m_showPlayback, ImGuiWindowFlags_AlwaysAutoResize ); - if( fi->flip ) + if( m_playback.zoom ) { - ImGui::Image( m_playback.texture, ImVec2( fi->w, fi->h ), ImVec2( 0, 1 ), ImVec2( 1, 0 ) ); + if( fi->flip ) + { + ImGui::Image( m_playback.texture, ImVec2( fi->w * 2, fi->h * 2 ), ImVec2( 0, 1 ), ImVec2( 1, 0 ) ); + } + else + { + ImGui::Image( m_playback.texture, ImVec2( fi->w * 2, fi->h * 2 ) ); + } } else { - ImGui::Image( m_playback.texture, ImVec2( fi->w, fi->h ) ); + if( fi->flip ) + { + ImGui::Image( m_playback.texture, ImVec2( fi->w, fi->h ), ImVec2( 0, 1 ), ImVec2( 1, 0 ) ); + } + else + { + ImGui::Image( m_playback.texture, ImVec2( fi->w, fi->h ) ); + } } int tmp = m_playback.frame + 1; if( ImGui::SliderInt( "Frame image", &tmp, 1, ficnt, "%d" ) ) @@ -9315,6 +9329,8 @@ void View::DrawPlayback() m_zvEnd = m_worker.GetFrameEnd( *frameSet, fi->frameRef ); } } + ImGui::SameLine(); + ImGui::Checkbox( "Zoom 2x", &m_playback.zoom ); TextFocused( "Timestamp:", TimeToString( tstart - m_worker.GetTimeBegin() ) ); ImGui::End(); } diff --git a/server/TracyView.hpp b/server/TracyView.hpp index 376647f4..6a416970 100644 --- a/server/TracyView.hpp +++ b/server/TracyView.hpp @@ -534,6 +534,7 @@ private: uint32_t currFrame = -1; bool pause = true; bool sync = false; + bool zoom = false; } m_playback; };