aboutsummaryrefslogtreecommitdiff
path: root/scene/gui/popup.cpp
diff options
context:
space:
mode:
authorGilles Roudiere2017-08-19 19:10:00 +0200
committerGilles Roudiere2017-08-19 19:10:00 +0200
commit06256cd7782de2d91cd9ed3bcb9a05e293397303 (patch)
tree48e2ea3efe55780838956a227ffe48ebba1bb9db /scene/gui/popup.cpp
parent523b3c11cf6de311cc3a711ed85ee48e72330a7b (diff)
downloadgodot-06256cd7782de2d91cd9ed3bcb9a05e293397303.tar.gz
godot-06256cd7782de2d91cd9ed3bcb9a05e293397303.tar.zst
godot-06256cd7782de2d91cd9ed3bcb9a05e293397303.zip
Some control fixes and removed useless lines
Diffstat (limited to '')
-rw-r--r--scene/gui/popup.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/scene/gui/popup.cpp b/scene/gui/popup.cpp
index f2ba6bfbc..b21139f96 100644
--- a/scene/gui/popup.cpp
+++ b/scene/gui/popup.cpp
@@ -276,9 +276,10 @@ void PopupPanel::set_child_rect(Control *p_child) {
Ref<StyleBox> p = get_stylebox("panel");
p_child->set_area_as_parent_rect();
- for (int i = 0; i < 4; i++) {
- p_child->set_margin(Margin(i), p->get_margin(Margin(i)));
- }
+ p_child->set_margin(MARGIN_LEFT, p->get_margin(MARGIN_LEFT));
+ p_child->set_margin(MARGIN_RIGHT, -p->get_margin(MARGIN_RIGHT));
+ p_child->set_margin(MARGIN_TOP, p->get_margin(MARGIN_TOP));
+ p_child->set_margin(MARGIN_BOTTOM, -p->get_margin(MARGIN_BOTTOM));
}
void PopupPanel::_notification(int p_what) {