Merge pull request #53063 from stebulba/3_x_undo_closecurve
This commit is contained in:
commit
bb60c97d10
1 changed files with 8 additions and 1 deletions
|
@ -503,7 +503,14 @@ void PathEditorPlugin::_close_curve() {
|
|||
if (c->get_point_count() < 2) {
|
||||
return;
|
||||
}
|
||||
c->add_point(c->get_point_position(0), c->get_point_in(0), c->get_point_out(0));
|
||||
if (c->get_point_position(0) == c->get_point_position(c->get_point_count() - 1)) {
|
||||
return;
|
||||
}
|
||||
UndoRedo *ur = editor->get_undo_redo();
|
||||
ur->create_action(TTR("Close Curve"));
|
||||
ur->add_do_method(c.ptr(), "add_point", c->get_point_position(0), c->get_point_in(0), c->get_point_out(0), -1);
|
||||
ur->add_undo_method(c.ptr(), "remove_point", c->get_point_count());
|
||||
ur->commit_action();
|
||||
}
|
||||
|
||||
void PathEditorPlugin::_handle_option_pressed(int p_option) {
|
||||
|
|
Loading…
Reference in a new issue