Trim the Ends of a Line

I needed to draw an arrow. I also needed to adjust its end points, so that they did not overlap with the labels that the arrows joined. This function moves a line's endpoints so that the line has the same slope, but beings and ends outside of a couple of rectangles that specify where to save room for a label.