- What browsers show this problem? Version 80.0.3987.132 (Official Build) (64-bit)
- Please share an example project (if possible).
- Describes the steps to reproduce this issue. Below
- What does Snap! currently do? Crashes
- What should Snap! do instead? Not crash.
I drew a filled in black box.
Selected the Paint bucket to fill with the new color.
Clicked several times rapidly.
After about 6-10 clicks SNAP! crashed totally displaying:
Happens in online and offline versions. I can repeatedly cause it to happen.
Don't ask me why I was clicking so many times on a box that had already changed color !
Actually, I was trying to reach a shade of black to match another background.
And could not quite tell if the color was actually changing or not, because it was so close.
Bitmap. Did not try vector.
@hardmath123 this is for you!
Maybe the solution is to RAF the floodfilling in chunks of k pixels where k is something unobjectionable like 1024. But I bet Jens won't like that.
I think I have finally been able to reproduce the problem.
The problem only appears when the that "color change" is made with the pipette. If you did the "color change" using the color picker (without using pipette tool), you can repeat the "filling action" (clicking serveral times) with no problem.
@tguneysu, can you confirm this?
Then, the problem is not inside the floodfill function. Now I see a bug inside the getUserColor func. It has
color.a = 255 but it must be
color.a = 1.
@jens, I test this and I will submit a PR.
Tested and with this fix, the problem disappears. @jens, PR submitted
Thanks as always for getting on top of this!
I tried it with and without pipette to select the color.
I believe you might be right that It always happened with the pipette at different times.
And I could not make it happen by just selecting a color from the palette.
I really hope that this is the real problem and you have solved it.