You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-06 12:20:30 +00:00
Fix Path2D's add new point's UndoRedo bug
This commit is contained in:
@@ -225,17 +225,20 @@ bool Path2DEditor::forward_gui_input(const Ref<InputEvent> &p_event) {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case ACTION_MOVING_POINT:
|
case ACTION_MOVING_POINT:
|
||||||
case ACTION_MOVING_NEW_POINT: {
|
|
||||||
if (original_mouse_pos != gpoint) {
|
if (original_mouse_pos != gpoint) {
|
||||||
if (action == ACTION_MOVING_POINT) {
|
undo_redo->create_action(TTR("Move Point in Curve"));
|
||||||
undo_redo->create_action(TTR("Move Point in Curve"));
|
undo_redo->add_undo_method(curve.ptr(), "set_point_position", action_point, moving_from);
|
||||||
undo_redo->add_undo_method(curve.ptr(), "set_point_position", action_point, moving_from);
|
|
||||||
}
|
|
||||||
undo_redo->add_do_method(curve.ptr(), "set_point_position", action_point, cpoint);
|
undo_redo->add_do_method(curve.ptr(), "set_point_position", action_point, cpoint);
|
||||||
undo_redo->add_do_method(canvas_item_editor, "update_viewport");
|
undo_redo->add_do_method(canvas_item_editor, "update_viewport");
|
||||||
undo_redo->add_undo_method(canvas_item_editor, "update_viewport");
|
undo_redo->add_undo_method(canvas_item_editor, "update_viewport");
|
||||||
undo_redo->commit_action(false);
|
undo_redo->commit_action(false);
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
case ACTION_MOVING_NEW_POINT: {
|
||||||
|
undo_redo->add_do_method(curve.ptr(), "set_point_position", action_point, cpoint);
|
||||||
|
undo_redo->add_undo_method(canvas_item_editor, "update_viewport");
|
||||||
|
undo_redo->add_do_method(canvas_item_editor, "update_viewport");
|
||||||
|
undo_redo->commit_action(false);
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case ACTION_MOVING_IN: {
|
case ACTION_MOVING_IN: {
|
||||||
|
|||||||
Reference in New Issue
Block a user