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.
This commit is contained in:
Dentomologist 2026-02-06 11:03:43 -08:00
parent f7b7267993
commit 0bf34a73b3

View File

@ -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;