### 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
_run(false, quick_run->get_selected());
}
void EditorNode::notify_all_debug_sessions_exited() {
	_menu_option_confirm(RUN_STOP, false);
	stop_button->set_pressed(false);
	editor_run.stop();
}
void EditorNode::add_io_error(const String &p_error) {
	_load_error_notify(singleton, p_error);
}
void EditorNode::_load_error_notify(void *p_ud, const String &p_text) {
	EditorNode *en = static_cast<EditorNode *>(p_ud);
	en->load_errors->add_image(en->gui_base->get_theme_icon(SNAME("Error"), SNAME("EditorIcons")));
	en->load_errors->add_text(p_text + "\n");
	en->load_error_dialog->popup_centered_ratio(0.5);
}
bool EditorNode::_find_scene_in_use(Node *p_node, const String &p_path) const {