Repository: godotengine/godot
File: editor/plugins/abstract_polygon_2d_editor.cpp (C++)

Code before:
		return false;
	}

	EditorUndoRedoManager *undo_redo = EditorUndoRedoManager::get_singleton();
	Ref<InputEventMouseButton> mb = p_event;

	if (!_has_resource()) {
		if (mb.is_valid() && mb->get_button_index() == MouseButton::LEFT && mb->is_pressed()) {
			create_resource->set_text(String("No polygon resource on this node.\nCreate and assign one?"));
			create_resource->popup_centered();
		}
		return (mb.is_valid() && mb->get_button_index() == MouseButton::LEFT);
	}

	CanvasItemEditor::Tool tool = CanvasItemEditor::get_singleton()->get_current_tool();
	if (tool != CanvasItemEditor::TOOL_SELECT) {
		return false;
	}

	if (mb.is_valid()) {
		Transform2D xform = canvas_item_editor->get_canvas_transform() * _get_node()->get_global_transform();

		Vector2 gpoint = mb->get_position();
		Vector2 cpoint = _get_node()->to_local(canvas_item_editor->snap_point(canvas_item_editor->get_canvas_transform().affine_inverse().xform(mb->get_position())));

		if (mode == MODE_EDIT || (_is_line() && mode == MODE_CREATE)) {
			if (mb->get_button_index() == MouseButton::LEFT) {
				if (mb->is_pressed()) {
					if (mb->is_ctrl_pressed() || mb->is_shift_pressed() || mb->is_alt_pressed()) {
						return false;
					}

					const PosVertex insert = closest_edge_point(gpoint);

					if (insert.valid()) {
						Vector<Vector2> vertices = _get_polygon(insert.polygon);

						if (vertices.size() < (_is_line() ? 2 : 3)) {
							vertices.push_back(cpoint);
							undo_redo->create_action(TTR("Edit Polygon"));
							selected_point = Vertex(insert.polygon, vertices.size());
							_action_set_polygon(insert.polygon, vertices);
							_commit_action();
							return true;
						} else {
							edited_point = PosVertex(insert.polygon, insert.vertex + 1, xform.affine_inverse().xform(insert.pos));
							vertices.insert(edited_point.vertex, edited_point.pos);
							pre_move_edit = vertices;
							selected_point = Vertex(edited_point.polygon, edited_point.vertex);
							edge_point = PosVertex();


Review comment (suggestion):
In this case, the check seems t be `no modifiers`, so it's probably should be `ctrl || meta || shift || alt`.

Code after:
		return false;
	}

	EditorUndoRedoManager *undo_redo = EditorUndoRedoManager::get_singleton();
	Ref<InputEventMouseButton> mb = p_event;

	if (!_has_resource()) {
		if (mb.is_valid() && mb->get_button_index() == MouseButton::LEFT && mb->is_pressed()) {
			create_resource->set_text(String("No polygon resource on this node.\nCreate and assign one?"));
			create_resource->popup_centered();
		}
		return (mb.is_valid() && mb->get_button_index() == MouseButton::LEFT);
	}

	CanvasItemEditor::Tool tool = CanvasItemEditor::get_singleton()->get_current_tool();
	if (tool != CanvasItemEditor::TOOL_SELECT) {
		return false;
	}

	if (mb.is_valid()) {
		Transform2D xform = canvas_item_editor->get_canvas_transform() * _get_node()->get_global_transform();

		Vector2 gpoint = mb->get_position();
		Vector2 cpoint = _get_node()->to_local(canvas_item_editor->snap_point(canvas_item_editor->get_canvas_transform().affine_inverse().xform(mb->get_position())));

		if (mode == MODE_EDIT || (_is_line() && mode == MODE_CREATE)) {
			if (mb->get_button_index() == MouseButton::LEFT) {
				if (mb->is_pressed()) {
					if (mb->is_meta_pressed() || mb->is_ctrl_pressed() || mb->is_shift_pressed() || mb->is_alt_pressed()) {
						return false;
					}

					const PosVertex insert = closest_edge_point(gpoint);

					if (insert.valid()) {
						Vector<Vector2> vertices = _get_polygon(insert.polygon);

						if (vertices.size() < (_is_line() ? 2 : 3)) {
							vertices.push_back(cpoint);
							undo_redo->create_action(TTR("Edit Polygon"));
							selected_point = Vertex(insert.polygon, vertices.size());
							_action_set_polygon(insert.polygon, vertices);
							_commit_action();
							return true;
						} else {
							edited_point = PosVertex(insert.polygon, insert.vertex + 1, xform.affine_inverse().xform(insert.pos));
							vertices.insert(edited_point.vertex, edited_point.pos);
							pre_move_edit = vertices;
							selected_point = Vertex(edited_point.polygon, edited_point.vertex);
							edge_point = PosVertex();