From f5d30a886d9f9e4d6d98c4f5d375c9e2ce9e0930 Mon Sep 17 00:00:00 2001 From: SuperDude88 <82904174+SuperDude88@users.noreply.github.com> Date: Tue, 14 Jul 2026 01:07:02 -0400 Subject: [PATCH] FPS Counter Fix (#2207) * FPS Counter Fix I broke it in #2198 oops * Run clang-format --- src/dusk/ui/overlay.cpp | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/dusk/ui/overlay.cpp b/src/dusk/ui/overlay.cpp index 3b5b43299e..d2bd3fe6c1 100644 --- a/src/dusk/ui/overlay.cpp +++ b/src/dusk/ui/overlay.cpp @@ -252,15 +252,20 @@ void Overlay::update() { if (getSettings().video.enableFpsOverlay.getValue()) { const int idx = getSettings().video.fpsOverlayCorner.getValue(); mFpsCounter->SetAttribute("open", ""); + mFpsCounter->RemoveProperty(Rml::PropertyId::Bottom); mFpsCounter->SetAttribute("corner", kFpsCorners[idx]); - if(idx == 2 && mPipelineProgress && mPipelineProgress->GetAttribute("open")) { - // 12 (height of pipeline box off bottom) + height of pipeline box + 3 (padding space) - mFpsCounter->SetProperty(Rml::PropertyId::Bottom, Rml::Property(15 + mPipelineProgress->GetOffsetHeight(), Rml::Unit::PX)); - } - else { - // Return fps counter to default height off the bottom - mFpsCounter->SetProperty(Rml::PropertyId::Bottom, Rml::Property(12, Rml::Unit::PX)); + if (idx == 2) { + if (mPipelineProgress && mPipelineProgress->GetAttribute("open")) { + // 12 (height of pipeline box off bottom) + height of pipeline box + 3 (padding + // space) + mFpsCounter->SetProperty(Rml::PropertyId::Bottom, + Rml::Property(15 + mPipelineProgress->GetOffsetHeight(), Rml::Unit::PX)); + } else { + // Return fps counter to default height off the bottom + mFpsCounter->SetProperty( + Rml::PropertyId::Bottom, Rml::Property(12, Rml::Unit::PX)); + } } const Uint64 perfFreq = SDL_GetPerformanceFrequency();