simulate_flood_fill_outside_check() could spin in an
infinite loop because it could sometimes set values in the
`touched[]` array to 0, which means the spot was never seen.
Values going in there are not boolean, but a 0-255 gradient,
for smoother fills on antialiased edges.
This change forces it to be a 1-255 value, ensuring that
a 'touched' spot on the canvas will have a non-zero `touched[]`
value.
h/t Pere for noticing the bug, providing some details,
and best of all providing a sample image to play with which
consistently invoked the crash. (It made mending this a
10 minute task for me, rather than an hours-long hunt to reproduce!
Big 'thanks' for doing that ahead of time!!!)
"Fill", as a new main-toolbar tool, was not recording snapshots
of the image for the "Undo" tool. Mended.
However, also updated the tool so that it doesn't _bother_ recording
into the undo buffer if the fill action is a no-op (e.g., clicking
the same spot a second time, or otherwise attempting to fill an
area with a color that's identical to what's already on the canvas).
Replace the somewhat-recently-added "nothing" item in the tool bar
with the "Fill" tool, which has been converted back from a Magic tool
to a regular tool.
Also, change bash "==" to sh "=" in "if [ ... ]" tests in Makefile.
Also, link to math library (via "-lm") to make sure "max()" is available to
magic tools.
Also, add missing mention of "--newcolorslast" and "--newcolorsfirst" to manpage.