### 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
bottom_panel_hb_editors = memnew(HBoxContainer);
	bottom_panel_hb_editors->set_h_size_flags(Control::SIZE_EXPAND_FILL);
	bottom_panel_hb->add_child(bottom_panel_hb_editors);
	editor_toaster = memnew(EditorToaster);
	bottom_panel_hb->add_child(editor_toaster);
	VBoxContainer *version_info_vbc = memnew(VBoxContainer);
	bottom_panel_hb->add_child(version_info_vbc);
	
	Control *v_spacer = memnew(Control);
	version_info_vbc->add_child(v_spacer);
	version_btn = memnew(LinkButton);
	version_btn->set_text(VERSION_FULL_CONFIG);
	String hash = String(VERSION_HASH);
	if (hash.length() != 0) {
		hash = " " + vformat("[%s]", hash.left(9));
	}
	
	version_btn->set_meta(META_TEXT_TO_COPY, "v" VERSION_FULL_BUILD + hash);
	
	version_btn->set_self_modulate(Color(1, 1, 1, 0.65));
	version_btn->set_underline_mode(LinkButton::UNDERLINE_MODE_ON_HOVER);
	version_btn->set_tooltip_text(TTR("Click to copy."));
	version_btn->connect("pressed", callable_mp(this, &EditorNode::_version_button_pressed));
	version_info_vbc->add_child(version_btn);
	
	Control *h_spacer = memnew(Control);
	bottom_panel_hb->add_child(h_spacer);
	bottom_panel_raise = memnew(Button);
	bottom_panel_raise->set_flat(true);
	bottom_panel_raise->set_icon(gui_base->get_theme_icon(SNAME("ExpandBottomDock"), SNAME("EditorIcons")));