Please refer to the attached image.
I have street lines that pass through a rectangle. I would like to clip the lines to the edge of the rectangle. For example, line A-B passes through the rectangle, and points A' and B' denote where the line touches the edge of the rectangle. I'd like to "shorten" line A-B so that its terminal points are really A' and B'.
What do you think?