Merge pull request #34133 from timothyqiu/guides-meta
Call clear_meta when clearing guides with the ruler
This commit is contained in:
commit
2acba6dcde
1 changed files with 10 additions and 2 deletions
|
@ -1111,7 +1111,11 @@ bool CanvasItemEditor::_gui_input_rulers_and_guides(const Ref<InputEvent> &p_eve
|
|||
if (dragged_guide_index >= 0) {
|
||||
vguides.remove(dragged_guide_index);
|
||||
undo_redo->create_action(TTR("Remove Vertical Guide"));
|
||||
undo_redo->add_do_method(EditorNode::get_singleton()->get_edited_scene(), "set_meta", "_edit_vertical_guides_", vguides);
|
||||
if (vguides.empty()) {
|
||||
undo_redo->add_do_method(EditorNode::get_singleton()->get_edited_scene(), "remove_meta", "_edit_vertical_guides_");
|
||||
} else {
|
||||
undo_redo->add_do_method(EditorNode::get_singleton()->get_edited_scene(), "set_meta", "_edit_vertical_guides_", vguides);
|
||||
}
|
||||
undo_redo->add_undo_method(EditorNode::get_singleton()->get_edited_scene(), "set_meta", "_edit_vertical_guides_", prev_vguides);
|
||||
undo_redo->add_undo_method(viewport, "update");
|
||||
undo_redo->commit_action();
|
||||
|
@ -1140,7 +1144,11 @@ bool CanvasItemEditor::_gui_input_rulers_and_guides(const Ref<InputEvent> &p_eve
|
|||
if (dragged_guide_index >= 0) {
|
||||
hguides.remove(dragged_guide_index);
|
||||
undo_redo->create_action(TTR("Remove Horizontal Guide"));
|
||||
undo_redo->add_do_method(EditorNode::get_singleton()->get_edited_scene(), "set_meta", "_edit_horizontal_guides_", hguides);
|
||||
if (hguides.empty()) {
|
||||
undo_redo->add_do_method(EditorNode::get_singleton()->get_edited_scene(), "remove_meta", "_edit_horizontal_guides_");
|
||||
} else {
|
||||
undo_redo->add_do_method(EditorNode::get_singleton()->get_edited_scene(), "set_meta", "_edit_horizontal_guides_", hguides);
|
||||
}
|
||||
undo_redo->add_undo_method(EditorNode::get_singleton()->get_edited_scene(), "set_meta", "_edit_horizontal_guides_", prev_hguides);
|
||||
undo_redo->add_undo_method(viewport, "update");
|
||||
undo_redo->commit_action();
|
||||
|
|
Loading…
Reference in a new issue