1
0
Fork 0

Merge pull request #85275 from TheSofox/anchors-undo-fix

Correctly restore Control position on undoing an Anchors Preset
This commit is contained in:
Thaddeus Crews 2024-12-10 14:15:47 -06:00
commit b26f9f0380
No known key found for this signature in database
GPG Key ID: 62181B86FE9E5D84
1 changed files with 5 additions and 1 deletions

View File

@ -4047,7 +4047,11 @@ void EditorInspector::_edit_set(const String &p_name, const Variant &p_value, bo
bool valid = false;
Variant value = object->get(p_name, &valid);
if (valid) {
undo_redo->add_undo_property(object, p_name, value);
if (Object::cast_to<Control>(object) && (p_name == "anchors_preset" || p_name == "layout_mode")) {
undo_redo->add_undo_method(object, "_edit_set_state", Object::cast_to<Control>(object)->_edit_get_state());
} else {
undo_redo->add_undo_property(object, p_name, value);
}
}
List<StringName> linked_properties;