Fix "Custom" anchor preset being ignored if the parent isn't a Control

(cherry picked from commit 697c4f1d0c)
This commit is contained in:
Michael Alexsander
2026-03-16 17:56:33 -03:00
committed by Thaddeus Crews
parent 7a18370d44
commit a8e815dfd9
+5 -5
View File
@@ -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) {