### Godot version

v4.0.beta15.official [4fa6edc88]

### System information

Windows 11

### Issue description

When drawing a polygon in the editor, several duplicate vertices are added to the polygon array for each click.  In the image below, I clicked three times to draw the triangle, but got 10 entries.  The number you get varies, though I don't know why; I've seen hundreds of points from drawing a hexagon.  I tested it with a Polygon2D, a CollisionPolygon2D, and a CollisionPolygon3D; the issues occurs with all of them.  It later occurred to me that this might happen with a Curve2D as well, and it does.

![image](https://user-images.githubusercontent.com/2808851/214926182-b8609b87-85a1-4a08-8017-be4eeec912c6.png)


### Steps to reproduce

Add a node that has a Polygon or Curve resource, such as a Polygon2D, draw some points, then check the PackedVector2Array resource.

### Minimal reproduction project

N/A
TTR("The current scene has unsaved changes.\nReload the saved scene anyway? This action cannot be undone."));
				confirmation->popup_centered();
				break;
			}
			int cur_idx = editor_data.get_edited_scene();
			_remove_edited_scene();
			Error err = load_scene(filename);
			if (err != OK) {
				ERR_PRINT("Failed to load scene");
			}
			editor_data.move_edited_scene_to_index(cur_idx);
			EditorUndoRedoManager::get_singleton()->clear_history(false, editor_data.get_current_edited_scene_history_id());
			scene_tabs->set_current_tab(cur_idx);
		} break;
		case RUN_PLAY: {
			run_play();
		} break;
		case RUN_PLAY_CUSTOM_SCENE: {
			if (run_custom_filename.is_empty() || editor_run.get_status() == EditorRun::STATUS_STOP) {
				_menu_option_confirm(RUN_STOP, true);
				quick_run->popup_dialog("PackedScene", true);
				quick_run->set_title(TTR("Quick Run Scene..."));
				play_custom_scene_button->set_pressed(false);
			} else {
				String last_custom_scene = run_custom_filename; 
				run_play_custom(last_custom_scene);
			}
		} break;
		case RUN_STOP: {
			if (editor_run.get_status() == EditorRun::STATUS_STOP) {