mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-07-23 05:32:42 -04:00
FPS Counter Fix (#2207)
* FPS Counter Fix I broke it in #2198 oops * Run clang-format
This commit is contained in:
+12
-7
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user