ui: Fixed FPS display not being visible

This commit is contained in:
WerWolv 2021-04-21 19:26:50 +02:00
parent ea71389982
commit 6527c942c2
1 changed files with 7 additions and 5 deletions

View File

@ -351,11 +351,13 @@ namespace hex {
} }
if (this->m_fpsVisible) { if (this->m_fpsVisible) {
char buffer[0x20]; ImGui::SameLine(ImGui::GetWindowWidth() - ImGui::GetCursorPosX() - 3 * ImGui::GetFontSize());
snprintf(buffer, 0x20, "%.1f FPS", ImGui::GetIO().Framerate); ImGui::Text("%.1f FPS", ImGui::GetIO().Framerate);
} else {
ImGui::SameLine(ImGui::GetWindowWidth() - ImGui::GetFontSize() * strlen(buffer) + 20); #if defined(DEBUG)
ImGui::TextUnformatted(buffer); ImGui::SameLine(ImGui::GetWindowWidth() - ImGui::GetCursorPosX());
ImGui::Text(ICON_FA_BUG, ImGui::GetIO().Framerate);
#endif
} }
ImGui::EndMenuBar(); ImGui::EndMenuBar();