Skip to content

Commit

Permalink
Merge pull request #45509 from KoBeWi/scaled_poop
Browse files Browse the repository at this point in the history
Fix popup_centered() for scaled popups
  • Loading branch information
akien-mga authored Jan 27, 2021
2 parents 27b22fd + a7a490e commit 7595228
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scene/gui/popup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ void Popup::popup_centered(const Size2 &p_size) {
Rect2 rect;
Size2 window_size = get_viewport_rect().size;
rect.size = p_size == Size2() ? get_size() : p_size;
rect.position = ((window_size - rect.size) / 2.0).floor();
rect.position = ((window_size - rect.size * get_scale()) / 2.0).floor();

_popup(rect, true);
}
Expand All @@ -157,7 +157,7 @@ void Popup::popup_centered_ratio(float p_screen_ratio) {
Rect2 rect;
Size2 window_size = get_viewport_rect().size;
rect.size = (window_size * p_screen_ratio).floor();
rect.position = ((window_size - rect.size) / 2.0).floor();
rect.position = ((window_size - rect.size * get_scale()) / 2.0).floor();

_popup(rect, true);
}
Expand Down

0 comments on commit 7595228

Please sign in to comment.