1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-22 18:53:28 +01:00

overlays: kinda fix performance graph margins (#9181)

This commit is contained in:
Megamouse 2020-10-31 17:32:31 +01:00 committed by GitHub
parent c2c559f8d9
commit 36149fd986
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -138,7 +138,6 @@ namespace rsx
void perf_metrics_overlay::reset_transforms()
{
const u16 perf_overlay_padding = m_font_size / 2;
const u16 graphs_padding = m_font_size * 2;
const u16 fps_graph_h = 60;
const u16 frametime_graph_h = 45;
@ -153,17 +152,14 @@ namespace rsx
if (m_framerate_graph_enabled)
{
bottom_margin += fps_graph_h;
if (m_frametime_graph_enabled)
{
bottom_margin += graphs_padding;
}
m_fps_graph.set_size(m_fps_graph.w, fps_graph_h);
bottom_margin += m_fps_graph.get_height();
}
if (m_frametime_graph_enabled)
{
bottom_margin += frametime_graph_h;
m_frametime_graph.set_size(m_frametime_graph.w, frametime_graph_h);
bottom_margin += m_frametime_graph.get_height();
}
}
@ -185,27 +181,21 @@ namespace rsx
// Position the graphs within the body
const u16 graphs_width = m_body.w;
const u16 body_left = m_body.x;
const u16 body_bottom = m_body.y + m_body.h + perf_overlay_padding;
u16 y_offset = m_body.y + m_body.h + perf_overlay_padding;
if (m_framerate_graph_enabled)
{
m_fps_graph.update();
m_fps_graph.set_pos(body_left, body_bottom);
m_fps_graph.set_pos(body_left, y_offset);
m_fps_graph.set_size(graphs_width, fps_graph_h);
y_offset += m_fps_graph.get_height();
}
if (m_frametime_graph_enabled)
{
m_frametime_graph.update();
u16 y_offset{};
if (m_framerate_graph_enabled)
{
y_offset = m_fps_graph.get_height();
}
m_frametime_graph.set_pos(body_left, body_bottom + y_offset);
m_frametime_graph.set_pos(body_left, y_offset);
m_frametime_graph.set_size(graphs_width, frametime_graph_h);
}
}