clip scanlines after you convert from poly to scanline
separate conversion of polygon to scanline from the clipping