mirror of
https://github.com/godotengine/godot.git
synced 2026-05-12 22:35:35 +00:00
Fix "Custom" anchor preset being ignored if the parent isn't a Control
(cherry picked from commit 697c4f1d0c)
This commit is contained in:
committed by
Thaddeus Crews
parent
7a18370d44
commit
a8e815dfd9
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user