Faster fill routine

A fast fill routine has already been shown in this site, but this version is better (if compiled, of course!) It may not fully fill some shapes though, unless they are convex. Mostly, it only needs to check one of the pixels adjacent to the last line plotted, rather than all of them.

A (rather construed) example was provided in the recent fill section to suggest that temporary storage needed for such a routine can become exorbitant. (Storage for every path which may have to be taken up a little later, that is.) On the other hand, a very modest number of five points at most, at all times, has to be stored for this version.

The program can still serve as a partial fill routine, even if the shape involved does not comply with the restriction imposed. A couple of additional mouse clicks is not too much if the routine will be eventually used by a human operator.

There is also a line drawing routine included. Drawing lines looks deceiptively easy, but there are actually several snags: For example, line segments which are continuous should also look so on the screen, but it is easy to miss one of the endpoints. And then a simple diagonal arrangement of pixels for slanted lines, will fool some fill routines. The code seems to work, though presently it does not bother to filter off- screen points.
1