target snapped to the nearest line