FPS Counter Fix (#2207)

* FPS Counter Fix

I broke it in #2198 oops

* Run clang-format
This commit is contained in:
SuperDude88
2026-07-14 01:07:02 -04:00
committed by GitHub
parent 8cc4ce94b8
commit f5d30a886d
+12 -7
View File
@@ -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();