Finish the algorithm to position boxes when their snapToLines flag is not set.