Skip to content

Commit 1eb0374

Browse files
committed
Merge pull request #117488 from YeldhamDev/layout_custom_anchor_fix
Fix "Custom" anchor preset being ignored if the parent isn't a `Control`
2 parents c40d3b9 + 697c4f1 commit 1eb0374

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

scene/gui/control.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1001,11 +1001,6 @@ Control::LayoutMode Control::_get_default_layout_mode() const {
10011001
}
10021002

10031003
void Control::_set_anchors_layout_preset(int p_preset) {
1004-
if (data.stored_layout_mode != LayoutMode::LAYOUT_MODE_UNCONTROLLED && data.stored_layout_mode != LayoutMode::LAYOUT_MODE_ANCHORS) {
1005-
// In other modes the anchor preset is non-operational and shouldn't be set to anything.
1006-
return;
1007-
}
1008-
10091004
if (p_preset == -1) {
10101005
if (!data.stored_use_custom_anchors) {
10111006
data.stored_use_custom_anchors = true;
@@ -1014,6 +1009,11 @@ void Control::_set_anchors_layout_preset(int p_preset) {
10141009
return; // Keep settings as is.
10151010
}
10161011

1012+
if (data.stored_layout_mode != LayoutMode::LAYOUT_MODE_UNCONTROLLED && data.stored_layout_mode != LayoutMode::LAYOUT_MODE_ANCHORS) {
1013+
// In other modes the anchor preset is non-operational and shouldn't be set to anything.
1014+
return;
1015+
}
1016+
10171017
bool list_changed = false;
10181018

10191019
if (data.stored_use_custom_anchors) {

0 commit comments

Comments
 (0)