Closed AnthonyyHL closed 8 months ago
This is great code, and I'm merging this PR. Welcome aboard as a Pixelitor contributor! I must say I'm impressed, because selection handling is one of the more complex parts of Pixelitor. However, I found some problems in the PR. I hope that you will fix them in a separate PR (or in multiple PRs). If not, I'll try to fix them myself.
BTW, don't worry about the "project goals": as long as a feature is commonly found in other image editors, it's a project goal to also add it to Pixelitor. There's a roadmap at https://github.com/lbalazscs/Pixelitor/blob/master/stuff/Roadmap.md but that is very incomplete.
I'm sorry for the problems. I'll try to work on fixing them gradually.
At the same time, I'm glad that the new feature had the opportunity to become part of this project :)
Great! Keep in mind that you don't need to wait until you've fixed all the issues. It's OK to fix them through multiple pull requests.
In the meantime I tried to research algorithms that don't use Area, and I found this: https://losingfight.com/blog/2007/08/28/how-to-implement-a-magic-wand-tool/ It seems that most people are using this algorithm for Magic Wand. For example this seems to be an (Android) Java implementation: http://www.java2s.com/Open-Source/Android_Free_Code/App/draw/com_jaween_pixelart_toolsMagicWand_java.htm
I think this algorithm should be much faster than using Areas, because Area is a very complex and powerful class, but here we don't need all that power, and on the other hand we could deal with millions of pixels.
Hello!
This is the PR with the Magic Wand feature. I hope it aligns with the project's goals and hope you like it!