The ViewTransform function creates an affine map which projects the window frame to the viewport. The endpoints of the line segment are given by line.p1 and line.p2 . The affine map defined above is used to transform the endpoints to p1 and p2 in screen space. Transform line segment endpoints. Using the affine map viewTransform defined above, the endpoints line.v1 and line.v2 of the line segment are mapped to screen space.
Project endpoints onto the screen.