-
-
Notifications
You must be signed in to change notification settings - Fork 401
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Further speed up of bucket fill #672
Further speed up of bucket fill #672
Conversation
managing has_selection condition differently
This allowed shortcircuiting away some tests to speed up common code paths.
Removed unused functions. Made conditions for pattern-fills clearer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried it and it seems to work great! I was under the impression that the only way the bucket fill would speed up like this would be using GDNative, and I am glad to be proven wrong. Thank you!
@MatteoPiovanelli-Laser I found a bug, pixels enclosed as shown here don't get effected by flood fill even if you click on top of it bucket.mp4 |
I'm on the wrong machine to test this right now. Does the same issue happen regardless of whether you click to the right or to the left of the affected pixel? Looks to me I might have done a +2 where I needed to do a +1 or something like that where I'm computing where segments start. I'll see if I can check this later tonight. |
yes, also i narrowed it down to this pull here: #681 |
i have narrowed it down further to line 305 of bucket.gd |
Yes, that actually makes a lot of sense. The code from my PR causes only segments at least two pixels long to be colored |
This fixes the bug found by @Variable-ind in Orama-Interactive#672
@Variable-ind do you want to go ahead and do the PR with the fix or should I? |
i think you should do it 😃 |
Yes, that's literally the change required to fix the bug you found |
Fixed in 9e7dd12 |
By cutting down on some tests that were being repeated after a point had already been found to be one to be colored, I made the flood fill a bit faster again.