Skip to content

Commit

Permalink
FullscreenUI: Extend achievement overlays to screen margins
Browse files Browse the repository at this point in the history
Fixes overlays getting caught in rounded corners on Android.
  • Loading branch information
stenzek committed Jan 11, 2025
1 parent ab790ed commit c43533f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/core/achievements.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
7 changes: 3 additions & 4 deletions src/util/imgui_fullscreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit c43533f

Please sign in to comment.