diff options
author | Koyper <tim@maffle.com> | 2023-12-27 10:19:52 -0600 |
---|---|---|
committer | Koyper <tim@maffle.com> | 2024-04-17 09:30:16 -0500 |
commit | 0881c81c136e3b133a480bedd14a7517bd8a373b (patch) | |
tree | 22c25a806686e6c690e724a502ef3c6bbfd05f25 /scene/gui/popup.cpp | |
parent | 30e71782afd9a1fd35707b89511bcd1aa538f673 (diff) | |
download | redot-engine-0881c81c136e3b133a480bedd14a7517bd8a373b.tar.gz |
Fix non-embedded Windows resizing to match Viewport content scale factor
Diffstat (limited to 'scene/gui/popup.cpp')
-rw-r--r-- | scene/gui/popup.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/scene/gui/popup.cpp b/scene/gui/popup.cpp index 0927404947..72ec4e4eb7 100644 --- a/scene/gui/popup.cpp +++ b/scene/gui/popup.cpp @@ -232,7 +232,8 @@ Size2 PopupPanel::_get_contents_minimum_size() const { void PopupPanel::_update_child_rects() { Vector2 cpos(theme_cache.panel_style->get_offset()); - Vector2 csize(get_size() - theme_cache.panel_style->get_minimum_size()); + Vector2 panel_size = Vector2(get_size()) / get_content_scale_factor(); + Vector2 csize = panel_size - theme_cache.panel_style->get_minimum_size(); for (int i = 0; i < get_child_count(); i++) { Control *c = Object::cast_to<Control>(get_child(i)); @@ -246,7 +247,7 @@ void PopupPanel::_update_child_rects() { if (c == panel) { c->set_position(Vector2()); - c->set_size(get_size()); + c->set_size(panel_size); } else { c->set_position(cpos); c->set_size(csize); |