OSD: Input recording overlap fixed (#9211)

This commit is contained in:
Sestain 2023-07-11 04:01:17 +03:00 committed by GitHub
parent 5d6b9d25bd
commit 8ba2f342df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 8 deletions

View File

@ -54,10 +54,10 @@
namespace ImGuiManager namespace ImGuiManager
{ {
static void FormatProcessorStat(std::string& text, double usage, double time); static void FormatProcessorStat(std::string& text, double usage, double time);
static void DrawPerformanceOverlay(); static void DrawPerformanceOverlay(float& position_y);
static void DrawSettingsOverlay(); static void DrawSettingsOverlay();
static void DrawInputsOverlay(); static void DrawInputsOverlay();
static void DrawInputRecordingOverlay(); static void DrawInputRecordingOverlay(float& position_y);
} // namespace ImGuiManager } // namespace ImGuiManager
static std::tuple<float, float> GetMinMax(gsl::span<const float> values) static std::tuple<float, float> GetMinMax(gsl::span<const float> values)
@ -97,13 +97,12 @@ void ImGuiManager::FormatProcessorStat(std::string& text, double usage, double t
fmt::format_to(std::back_inserter(text), "{:.1f}% ({:.2f}ms)", usage, time); fmt::format_to(std::back_inserter(text), "{:.1f}% ({:.2f}ms)", usage, time);
} }
void ImGuiManager::DrawPerformanceOverlay() void ImGuiManager::DrawPerformanceOverlay(float& position_y)
{ {
const float scale = ImGuiManager::GetGlobalScale(); const float scale = ImGuiManager::GetGlobalScale();
const float shadow_offset = std::ceil(1.0f * scale); const float shadow_offset = std::ceil(1.0f * scale);
const float margin = std::ceil(10.0f * scale); const float margin = std::ceil(10.0f * scale);
const float spacing = std::ceil(5.0f * scale); const float spacing = std::ceil(5.0f * scale);
float position_y = margin;
ImFont* const fixed_font = ImGuiManager::GetFixedFont(); ImFont* const fixed_font = ImGuiManager::GetFixedFont();
ImFont* const standard_font = ImGuiManager::GetStandardFont(); ImFont* const standard_font = ImGuiManager::GetStandardFont();
@ -615,13 +614,13 @@ void ImGuiManager::DrawInputsOverlay()
} }
} }
void ImGuiManager::DrawInputRecordingOverlay() void ImGuiManager::DrawInputRecordingOverlay(float& position_y)
{ {
const float scale = ImGuiManager::GetGlobalScale(); const float scale = ImGuiManager::GetGlobalScale();
const float shadow_offset = std::ceil(1.0f * scale); const float shadow_offset = std::ceil(1.0f * scale);
const float margin = std::ceil(10.0f * scale); const float margin = std::ceil(10.0f * scale);
const float spacing = std::ceil(5.0f * scale); const float spacing = std::ceil(5.0f * scale);
float position_y = margin; position_y += margin;
ImFont* const fixed_font = ImGuiManager::GetFixedFont(); ImFont* const fixed_font = ImGuiManager::GetFixedFont();
ImFont* const standard_font = ImGuiManager::GetStandardFont(); ImFont* const standard_font = ImGuiManager::GetStandardFont();
@ -666,8 +665,9 @@ void ImGuiManager::DrawInputRecordingOverlay()
void ImGuiManager::RenderOverlays() void ImGuiManager::RenderOverlays()
{ {
DrawPerformanceOverlay(); float position_y = 0;
DrawInputRecordingOverlay(); DrawInputRecordingOverlay(position_y);
DrawPerformanceOverlay(position_y);
DrawSettingsOverlay(); DrawSettingsOverlay();
DrawInputsOverlay(); DrawInputsOverlay();
} }