From c43533f8d888227d153cbac9a7eefcde7c5f3c8c Mon Sep 17 00:00:00 2001 From: Stenzek Date: Sun, 12 Jan 2025 01:02:56 +1000 Subject: [PATCH] FullscreenUI: Extend achievement overlays to screen margins Fixes overlays getting caught in rounded corners on Android. --- src/core/achievements.cpp | 3 ++- src/util/imgui_fullscreen.cpp | 7 +++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/core/achievements.cpp b/src/core/achievements.cpp index bc0dd2258..4411af65d 100644 --- a/src/core/achievements.cpp +++ b/src/core/achievements.cpp @@ -2237,12 +2237,13 @@ void Achievements::DrawGameOverlays() const auto lock = GetLock(); + const float margin = std::max(ImGuiManager::GetScreenMargin(), LayoutScale(10.0f)); const float spacing = LayoutScale(10.0f); const float padding = LayoutScale(10.0f); const ImVec2 image_size = LayoutScale(ImGuiFullscreen::LAYOUT_MENU_BUTTON_HEIGHT, ImGuiFullscreen::LAYOUT_MENU_BUTTON_HEIGHT); const ImGuiIO& io = ImGui::GetIO(); - ImVec2 position = ImVec2(io.DisplaySize.x - padding, io.DisplaySize.y - padding); + ImVec2 position = ImVec2(io.DisplaySize.x - margin, io.DisplaySize.y - margin); ImDrawList* dl = ImGui::GetBackgroundDrawList(); if (!s_state.active_challenge_indicators.empty()) diff --git a/src/util/imgui_fullscreen.cpp b/src/util/imgui_fullscreen.cpp index 3dd133d8e..607c1dc7b 100644 --- a/src/util/imgui_fullscreen.cpp +++ b/src/util/imgui_fullscreen.cpp @@ -514,12 +514,11 @@ void ImGuiFullscreen::EndLayout() DrawFullscreenFooter(); - const float notification_margin = LayoutScale(10.0f); + const float margin = std::max(ImGuiManager::GetScreenMargin(), LayoutScale(10.0f)); const float spacing = LayoutScale(10.0f); const float notification_vertical_pos = GetNotificationVerticalPosition(); - ImVec2 position(notification_margin, - notification_vertical_pos * ImGui::GetIO().DisplaySize.y + - ((notification_vertical_pos >= 0.5f) ? -notification_margin : notification_margin)); + ImVec2 position(margin, notification_vertical_pos * ImGui::GetIO().DisplaySize.y + + ((notification_vertical_pos >= 0.5f) ? -margin : margin)); DrawBackgroundProgressDialogs(position, spacing); DrawNotifications(position, spacing); DrawToast();