Skip to content

Commit 8841340

Browse files
committed
Shift positions of ping and FPS counters
Also make everything else draw in the top right, for real this time
1 parent cedae8b commit 8841340

File tree

2 files changed

+18
-16
lines changed

2 files changed

+18
-16
lines changed

Source/Core/VideoCommon/OnScreenDisplay.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,8 @@ void DrawMessages()
156156
{
157157
const bool draw_messages = Config::Get(Config::MAIN_OSD_MESSAGES);
158158
const float current_x =
159-
LEFT_MARGIN * ImGui::GetIO().DisplayFramebufferScale.x + s_obscured_pixels_left;
160-
float current_y = TOP_MARGIN * ImGui::GetIO().DisplayFramebufferScale.y + s_obscured_pixels_top;
159+
(LEFT_MARGIN + 100.0f) * ImGui::GetIO().DisplayFramebufferScale.x + s_obscured_pixels_left;
160+
float current_y = (TOP_MARGIN - 2.5f) * ImGui::GetIO().DisplayFramebufferScale.y + s_obscured_pixels_top;
161161
int index = 0;
162162

163163
std::lock_guard lock{s_messages_mutex};

Source/Core/VideoCommon/PerformanceMetrics.cpp

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,10 @@ void PerformanceMetrics::DrawImGuiStats(const float backbuffer_scale)
138138
const ImGuiCond set_next_position_condition =
139139
(display_size_changed || !movable_overlays) ? ImGuiCond_Always : ImGuiCond_FirstUseEver;
140140

141-
float window_y = window_padding + 40.0f * backbuffer_scale;
142-
float window_x = window_padding;
141+
float window_y = window_padding;
142+
float window_y_left = window_padding;
143+
float window_x = display_size.x - window_padding;
144+
float window_x_left = window_padding;
143145

144146
const auto clamp_window_position = [&]() {
145147
const ImVec2 position = ImGui::GetWindowPos();
@@ -173,10 +175,10 @@ void PerformanceMetrics::DrawImGuiStats(const float backbuffer_scale)
173175
{
174176
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(0, 4.f * backbuffer_scale));
175177

176-
// Position in the top-left corner of the screen.
178+
// Position in the top-right corner of the screen.
177179

178180
ImGui::SetNextWindowPos(ImVec2(window_x, window_y), set_next_position_condition,
179-
ImVec2(0.0f, 0.0f));
181+
ImVec2(1.0f, 0.0f));
180182
ImGui::SetNextWindowSize(ImVec2(graph_width, graph_height));
181183
ImGui::SetNextWindowBgAlpha(bg_alpha);
182184
window_y += graph_height + window_padding;
@@ -249,18 +251,18 @@ void PerformanceMetrics::DrawImGuiStats(const float backbuffer_scale)
249251

250252
if (g_ActiveConfig.bShowSpeed)
251253
{
252-
// Position in the top-left corner of the screen.
254+
// Position in the top-right corner of the screen.
253255
float window_height = 47.f * backbuffer_scale;
254256

255257
ImGui::SetNextWindowPos(ImVec2(window_x, window_y), set_next_position_condition,
256-
ImVec2(0.0f, 0.0f));
258+
ImVec2(1.0f, 0.0f));
257259
ImGui::SetNextWindowSize(ImVec2(window_width, window_height));
258260
ImGui::SetNextWindowBgAlpha(bg_alpha);
259261

260262
if (stack_vertically)
261263
window_y += window_height + window_padding;
262264
else
263-
window_x += window_width + window_padding;
265+
window_x -= window_width + window_padding;
264266

265267
if (ImGui::Begin("SpeedStats", nullptr, imgui_flags))
266268
{
@@ -276,16 +278,16 @@ void PerformanceMetrics::DrawImGuiStats(const float backbuffer_scale)
276278
int count = g_ActiveConfig.bShowFPS + 2 * g_ActiveConfig.bShowFTimes;
277279
float window_height = (12.f + 17.f * count) * backbuffer_scale;
278280

279-
// Position in the top-left corner of the screen.
280-
ImGui::SetNextWindowPos(ImVec2(window_x, window_y), set_next_position_condition,
281+
// P+ change: position in the top-left corner of the screen.
282+
ImGui::SetNextWindowPos(ImVec2(window_x_left, window_y_left), set_next_position_condition,
281283
ImVec2(0.0f, 0.0f));
282284
ImGui::SetNextWindowSize(ImVec2(window_width, window_height));
283285
ImGui::SetNextWindowBgAlpha(bg_alpha);
284286

285-
if (stack_vertically)
287+
/* if (stack_vertically)
286288
window_y += window_height + window_padding;
287289
else
288-
window_x += window_width + window_padding;
290+
window_x -= window_width + window_padding; */
289291

290292
if (ImGui::Begin("FPSStats", nullptr, imgui_flags))
291293
{
@@ -308,16 +310,16 @@ void PerformanceMetrics::DrawImGuiStats(const float backbuffer_scale)
308310
int count = g_ActiveConfig.bShowVPS + 2 * g_ActiveConfig.bShowVTimes;
309311
float window_height = (12.f + 17.f * count) * backbuffer_scale;
310312

311-
// Position in the top-left corner of the screen.
313+
// Position in the top-right corner of the screen.
312314
ImGui::SetNextWindowPos(ImVec2(window_x, window_y), set_next_position_condition,
313-
ImVec2(0.0f, 0.0f));
315+
ImVec2(1.0f, 0.0f));
314316
ImGui::SetNextWindowSize(ImVec2(window_width, (12.f + 17.f * count) * backbuffer_scale));
315317
ImGui::SetNextWindowBgAlpha(bg_alpha);
316318

317319
if (stack_vertically)
318320
window_y += window_height + window_padding;
319321
else
320-
window_x += window_width + window_padding;
322+
window_x -= window_width + window_padding;
321323

322324
if (ImGui::Begin("VPSStats", nullptr, imgui_flags))
323325
{

0 commit comments

Comments
 (0)