Skip to content
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

Bucket Fill is slow #4

Open
s-egge opened this issue Dec 29, 2023 · 0 comments
Open

Bucket Fill is slow #4

s-egge opened this issue Dec 29, 2023 · 0 comments

Comments

@s-egge
Copy link
Owner

s-egge commented Dec 29, 2023

Filling large areas with the bucket-fill tool is slow when there are a lot of pixels. Currently, each pixel is filled individually:

    c.beginPath();
    c.fillStyle = pixelColor;
    c.fillRect(x, y, pixelLength, pixelLength);
    c.fill();

This can likely be sped up by first getting all pixels that need to be filled that are touching each other in a line and filling them all at once, and going up/down from there to check for more lines of pixels or individual pixels to fill.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant