cloudhead / rx

👾 Modern and minimalist pixel editor
https://discord.gg/xHggPjfsS9
GNU General Public License v3.0
3.07k stars 109 forks source link

Faster FloodFill #101

Closed JEphron closed 3 years ago

JEphron commented 3 years ago

The flood fill algorithm introduced in https://github.com/cloudhead/rx/pull/100 was simple, but not very fast. I don't know how common it is for people to use rx to edit large-ish images, but I figured it'd be worth taking a little extra time to optimize. In release mode, this algorithm fills a 1024x1024 canvas in ~12ms, vs ~210ms for old algorithm

cloudhead commented 3 years ago

Sick. Fills 1024x1024 in 8ms on my computer.