Comments (9)
Hi, thanks for letting me know! Does this happen on both Chrome and FF then? What versions of both are you using? Which OS?
You might have noticed that this feature was added literally a few moments ago, so it's possible there are still bugs. However, I can't replicate this on Chrome or FF. Also, since it happens immediately after you switch the mode, it's probably not related to the filling algorithm itself, which is good.
from atrament.
Yea I noticed the update. It happens on both, FireFox does return the "unresponsive script" error dialog.
Windows 10
Chrome = Version 49.0.2623.112 m
FireFox = 43.0.1 && 44.0.2 && 45.0.2 (it's been awhile since I've used FF so I tested, updated, tested and updated each version 😄 )
from atrament.
Hmm I've got the same versions, too, so this must be a platform-specific issue. Unfortunately I don't have access to a PC. Would you be able to build the lib from the source, and perhaps do some console logs to see where it breaks?
If not, I can get hold of a PC at some point, it just won't be today I'm afraid.
Also, do you not actually click on the canvas when it happens? It seems very unlikely that the script would freeze by just setting the mode variable.
from atrament.
I'll try to run the source and do some logging and profiling if possible. Might be later today. I'll let you know if I find anything 👍
Just changing the mode seems to lock it up.
from atrament.
I checked it on PC in Chrome and FF and if you try to fill whole canvas JS thread locks UI for a 5-7 seconds. In Mac it's faster ~ 3-4 sec.
@jakubfiala I reverted my local version to commit I did first on bucket filling and in Chrome on Mac it takes kinda 0.5 sec for a whole canvas filling, on PC ~ 1sec.
Will go deeper to understand what change makes it lag
from atrament.
@ptkach that's good to know. In the future we'll be able to pass ImageData
to a Web Worker so the JS thread doesn't freeze at all, but who knows when that will get 100% browser support.
One thing I did change in my modifications was that each colorPixel operation also performs two extra matchColor checks and potentially colors the two neighboring pixels, so that could be part of the problem.
In any case, what @bradmartin is experiencing seems like a different issue.
from atrament.
I think it makes sense to check with my changes. Now it should be several times faster (< 1sec on PC).
from atrament.
@bradmartin #6 is now merged to both master and gh-pages, so you should be able to test this problem with the demo.
from atrament.
Much better 👍
from atrament.
Related Issues (20)
- opacity does not work HOT 1
- Problems with hand-down on iPad with apple pencil HOT 5
- Demo link HOT 2
- Save strokes with uniform sizes HOT 2
- Add a "disable" option for drawing mode. HOT 1
- How to retain smoothing effect in SVG when programmatically creating SVG from stroke data HOT 2
- Sometimes drawing adds a line between beginning and end of stroke HOT 1
- Undo implementation HOT 5
- question about layers/transparency HOT 2
- Realtime draw updates HOT 4
- Different behavior when Inspect Element is open on Chrome HOT 4
- Online Demo Error HOT 1
- Bundle with Rollup HOT 1
- Test rendering with WebGL HOT 1
- QA with iPad + Apple Pencil and a similar Android tablet HOT 2
- Add support for advanced `Touch` properties HOT 1
- Adaptive stroke causes flood fill artifacts HOT 2
- Fix demo link in readme HOT 1
- Just add some text labelling for drawings HOT 3
- Can only undo for one step HOT 4
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 atrament.