3 ms·
Kudos, writing flood fill is tricky...lots of gotchas. Another tip: always use === instead of == if you are doing numeric compares. You might see a perf incre
by binarymax 14y ago
Kudos, writing flood fill is tricky...lots of gotchas. Another tip: always use === instead of == if you are doing numeric compares. You might see a perf increase there.
If you are interested, I have a decently quick floodfill here. Might be worth a benchmark but never got around to it: https://gist.github.com/4071852 https://gist.github.com/4071852
Another thing is, this stuff can easily be thrown into a webworker, which will definitely help with some more complicated fills on larger canvases.