How to handle horizontal lines in the Polyfill Algorithm?
See Polygon Filling. It gives one method to deal with edges parallel to scanline. It says that it is imperfect, but you can ignore the horizontal edges. Other solution is to take either left or right endpoint of horizontal edge (any one point only). Yet another solution is to take right or left endpoint depending on the situation, so that whole edge is filled.

If you ignore horizontal lines you should get something like the following: