Modification to avoid drawing line when dragging vertex