diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index fca65b4ca23..499e53be1cb 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -980,11 +980,6 @@ Control::LayoutMode Control::_get_default_layout_mode() const { } void Control::_set_anchors_layout_preset(int p_preset) { - if (data.stored_layout_mode != LayoutMode::LAYOUT_MODE_UNCONTROLLED && data.stored_layout_mode != LayoutMode::LAYOUT_MODE_ANCHORS) { - // In other modes the anchor preset is non-operational and shouldn't be set to anything. - return; - } - if (p_preset == -1) { if (!data.stored_use_custom_anchors) { data.stored_use_custom_anchors = true; @@ -993,6 +988,11 @@ void Control::_set_anchors_layout_preset(int p_preset) { return; // Keep settings as is. } + if (data.stored_layout_mode != LayoutMode::LAYOUT_MODE_UNCONTROLLED && data.stored_layout_mode != LayoutMode::LAYOUT_MODE_ANCHORS) { + // In other modes the anchor preset is non-operational and shouldn't be set to anything. + return; + } + bool list_changed = false; if (data.stored_use_custom_anchors) {