My version of a scanline fill. Doesn't yet use Bresenhams - just interpolates using floating-point arithmetic which would be relatively expensive on a real machine. It's a trivial mod to make the fill primitive an axis-aligned quad rather than a pair of triangles. I did originally distinguish between flat top and flat bottom triangles but folded all that into one procedure as it isn't necessary unless you're implementing it with Bresenham's (and that's just to save the use of calculating a step variable containing +1 or -1.)
See the discussion at http://scratch.mit.edu/discuss/topic/90330/ The line-drawing DDA came from tylerbata's http://scratch.mit.edu/projects/2906972/ Quad library available at http://scratch.mit.edu/projects/51273132/