From ac331d034359d42fca68c54d761fb52190be6807 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Mon, 22 Nov 2021 01:19:37 +0100 Subject: [PATCH] Fix one frame lag of out-of-trace dimming. --- server/TracyView.cpp | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index d9383d86..e3075e54 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -2916,18 +2916,6 @@ void View::DrawZones() const auto w = ImGui::GetWindowContentRegionWidth() - ImGui::GetStyle().ScrollbarSize; const auto timespan = m_vd.zvEnd - m_vd.zvStart; auto pxns = w / double( timespan ); - { - const auto tbegin = 0; - const auto tend = m_worker.GetLastTime(); - if( tbegin > m_vd.zvStart ) - { - draw->AddRectFilled( linepos, linepos + ImVec2( ( tbegin - m_vd.zvStart ) * pxns, lineh ), 0x44000000 ); - } - if( tend < m_vd.zvEnd ) - { - draw->AddRectFilled( linepos + ImVec2( ( tend - m_vd.zvStart ) * pxns, 0 ), linepos + ImVec2( w, lineh ), 0x44000000 ); - } - } const auto winpos = ImGui::GetWindowPos(); const auto winsize = ImGui::GetWindowSize(); @@ -2945,6 +2933,19 @@ void View::DrawZones() HandleZoneViewMouse( timespan, ImGui::GetCursorScreenPos(), w, pxns ); } + { + const auto tbegin = 0; + const auto tend = m_worker.GetLastTime(); + if( tbegin > m_vd.zvStart ) + { + draw->AddRectFilled( linepos, linepos + ImVec2( ( tbegin - m_vd.zvStart ) * pxns, lineh ), 0x44000000 ); + } + if( tend < m_vd.zvEnd ) + { + draw->AddRectFilled( linepos + ImVec2( ( tend - m_vd.zvStart ) * pxns, 0 ), linepos + ImVec2( w, lineh ), 0x44000000 ); + } + } + DrawZoneFramesHeader(); auto& frames = m_worker.GetFrames(); for( auto fd : frames )