Diagonal line loop

Shouldn’t both x1 & x2 coords. be the same for vertical lines?
line(i, 0, i, height);

Also take a look at these style functions: