Comments (3)
Ok, got it I think. In line 26:
for(var j=w;j<e;j+=4) {
change to
for(var j=w+4;j<e;j+=4) {
since e is the first differently coloured pixel to the right of the start, it makes sense to stop the loop before we hit it; similarly w is the first differently coloured pixel we hit to the left of the start so I think we need to begin the loop on the pixel after w.
My colouring of the wards of Bristol works fine with this change applied.
from floodfill.js.
I can also confirm this bug.
It's even worse with other areas of this image, for example, 220 x 135:
However issue does seem to be a duplicate of #10
from floodfill.js.
@bristol-d Great job! I suppose it worth a PR.
from floodfill.js.
Related Issues (16)
- Fill clear? HOT 2
- Infinite loop at high tolerance HOT 1
- Using floats causes crash HOT 2
- Minified version does not work HOT 4
- Suggestions to make it more awesome HOT 2
- If you select a fill color too close to the color at input coordinates, it freezes
- maybe can use this code HOT 1
- Strange out-of-bounds bug HOT 4
- Perfomance Improvements // Profiling HOT 4
- typeof CanvasRenderingContext2D in iPhone safari is 'object' HOT 2
- anti-alias not work
- alpha channel not working for me HOT 1
- Three dimensional flood fill? HOT 2
- Fill skips x =1 on canvas HOT 2
- Painting black on white with a tolerance of zero freezes everything HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from floodfill.js.