diff options
| author | Dentomologist <dentomologist@gmail.com> | 2026-02-06 11:03:43 -0800 |
|---|---|---|
| committer | Dentomologist <dentomologist@gmail.com> | 2026-02-06 13:30:48 -0800 |
| commit | 0bf34a73b31efc196ef80f9c5d81527788548d5e (patch) | |
| tree | fbfaf0a8b60fb1fc9ab23b0cd708006782c29166 /Source/Core/VideoCommon | |
| parent | f7b7267993db376dffc250fe3dbdedacd67869b2 (diff) | |
PerformanceMetrics: Clamp graph minimum auto size
Add a minimum value for the automatic size of the performance metrics
graph. The graph can still be manually resized smaller than this limit.
This prevents the graph from automatically resizing itself to be too
small to contain the full graph and legend, which happened when using
native resolution with `Auto-Adjust Window Size` enabled.
Diffstat (limited to 'Source/Core/VideoCommon')
| -rw-r--r-- | Source/Core/VideoCommon/PerformanceMetrics.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Source/Core/VideoCommon/PerformanceMetrics.cpp b/Source/Core/VideoCommon/PerformanceMetrics.cpp index bee2de40a2..0e2e371d4e 100644 --- a/Source/Core/VideoCommon/PerformanceMetrics.cpp +++ b/Source/Core/VideoCommon/PerformanceMetrics.cpp @@ -170,8 +170,11 @@ void PerformanceMetrics::DrawImGuiStats(const float backbuffer_scale) ImGui::SetWindowPos(ImVec2(clamped_window_x, clamped_window_y), ImGuiCond_Always); }; - const float graph_width = display_size.x / 4.0; - const float graph_height = display_size.y / 4.0; + const float min_auto_graph_width = 200.f * backbuffer_scale + 2.f * window_padding; + const float min_auto_graph_height = 144.f * backbuffer_scale + 2.f * window_padding; + + const float graph_width = std::max(min_auto_graph_width, display_size.x / 4.f); + const float graph_height = std::max(min_auto_graph_height, display_size.y / 4.f); const bool stack_vertically = !g_ActiveConfig.bShowGraphs; |
