Fix "Custom" anchor preset being ignored if the parent isn't a Control
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user