Seems it's never finished: the calculation of the bottom coordinate to fill
has to be done before clamping the polygon top, otherwise it's wrong.