Skip to content

Commit 2fd81f5

Browse files
committed
ImGuiManager: Make margins consistent across OSD/achievements
1 parent 6f39b2f commit 2fd81f5

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

src/core/fullscreenui_widgets.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5345,7 +5345,7 @@ void FullscreenUI::UpdateNotificationsRunIdle()
53455345
FullscreenUI::NotificationLayout::NotificationLayout(NotificationLocation location)
53465346
: m_spacing(LayoutScale(10.0f)), m_location(location)
53475347
{
5348-
const float screen_margin = std::max(ImGuiManager::GetScreenMargin(), LayoutScale(10.0f));
5348+
const float screen_margin = ImGuiManager::GetScreenMargin();
53495349

53505350
// android goes a little lower due to on-screen buttons
53515351
#ifndef __ANDROID__

src/core/imgui_overlays.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -243,10 +243,9 @@ void ImGuiManager::RenderTextOverlays(const GPUBackend* gpu)
243243
const bool paused = VideoThread::IsSystemPaused();
244244

245245
const float scale = ImGuiManager::GetGlobalScale();
246-
const float f_margin = ImGuiManager::GetScreenMargin() * scale;
247-
const float margin = ImCeil(ImGuiManager::GetScreenMargin() * scale);
246+
const float margin = ImGuiManager::GetScreenMargin();
248247
const float spacing = ImCeil(5.0f * scale);
249-
float position_y = ImFloor(f_margin);
248+
float position_y = margin;
250249
DrawPerformanceOverlay(gpu, position_y, scale, margin, spacing);
251250
DrawMediaCaptureOverlay(position_y, scale, margin, spacing);
252251

@@ -646,7 +645,7 @@ void ImGuiManager::DrawEnhancementsOverlay(const GPUBackend* gpu)
646645

647646
const float scale = ImGuiManager::GetGlobalScale();
648647
const float shadow_offset = 1.0f * scale;
649-
const float margin = ImGuiManager::GetScreenMargin() * scale;
648+
const float margin = ImGuiManager::GetScreenMargin();
650649
ImFont* const font = ImGuiManager::GetFixedFont();
651650
const float font_size = ImGuiManager::GetFixedFontSize();
652651
const float font_weight = 600.0f;
@@ -861,7 +860,7 @@ void ImGuiManager::DrawInputsOverlay()
861860
{
862861
const float scale = ImGuiManager::GetGlobalScale();
863862
const float shadow_offset = ImCeil(1.0f * scale);
864-
const float margin = ImGuiManager::GetScreenMargin() * scale;
863+
const float margin = ImGuiManager::GetScreenMargin();
865864
const float spacing = ImCeil(5.0f * scale);
866865
ImFont* const font = ImGuiManager::GetTextFont();
867866
const float font_size = ImGuiManager::GetOSDFontSize();

src/util/imgui_manager.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1060,7 +1060,7 @@ void ImGuiManager::DrawOSDMessages(Timer::Value current_time)
10601060
const ImVec4 subtext_color = DarkerColor(text_color, 0.85f);
10611061
const float scale = s_state.global_scale;
10621062
const float spacing = std::ceil(6.0f * scale);
1063-
const float margin = std::ceil(GetScreenMargin() * scale);
1063+
const float margin = GetScreenMargin();
10641064
const float padding = std::ceil(10.0f * scale);
10651065
const float rounding = std::ceil(10.0f * scale);
10661066
const float normal_icon_margin = std::ceil(4.0f * scale);
@@ -1280,7 +1280,7 @@ float ImGuiManager::GetGlobalScale()
12801280

12811281
float ImGuiManager::GetScreenMargin()
12821282
{
1283-
return g_gpu_settings.display_osd_margin;
1283+
return std::ceil(g_gpu_settings.display_osd_margin * s_state.global_scale);
12841284
}
12851285

12861286
ImFont* ImGuiManager::GetTextFont()

0 commit comments

Comments
 (0)