From 697c4f1d0cbdd09c01a18846c08215d0823dc6fd Mon Sep 17 00:00:00 2001 From: Michael Alexsander Date: Mon, 16 Mar 2026 17:56:33 -0300 Subject: [PATCH] Fix "Custom" anchor preset being ignored if the parent isn't a `Control` --- scene/gui/control.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index 2425642a98..5dcec0724c 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -1001,11 +1001,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; @@ -1014,6 +1009,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) {