From 992fba7e07f91de2b6f02a56df48e527923c0490 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Thu, 14 May 2020 17:53:46 +0200 Subject: [PATCH] Move profiler FPS display to upper-right corner. --- server/TracyView.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 44f6e6b1..5611cb5a 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -992,6 +992,14 @@ void View::DrawNotificationArea() ImGui::SameLine(); TextDisabledUnformatted( m_notificationText.c_str() ); } + + if( m_smallFont ) ImGui::PushFont( m_smallFont ); + const auto wpos = ImGui::GetWindowPos(); + const auto w = ImGui::GetWindowContentRegionWidth(); + const auto fps = RealToString( int( io.Framerate + 0.5f ) ); + const auto fpssz = ImGui::CalcTextSize( fps ).x; + ImGui::GetWindowDrawList()->AddText( wpos + ImVec2( w-fpssz, 0 ), 0x88FFFFFF, fps ); + if( m_smallFont ) ImGui::PopFont(); } bool View::DrawConnection() @@ -13133,9 +13141,6 @@ void View::DrawInfo() ImGui::TreePop(); } - ImGui::Separator(); - TextFocused( "Profiler FPS:", RealToString( int( io.Framerate ) ) ); - ImGui::Separator(); TextFocused( "PID:", RealToString( m_worker.GetPid() ) ); TextFocused( "Host info:", m_worker.GetHostInfo().c_str() );