Comments (4)
@nielshoogendoorn thanks for the suggestion!
Personally I think this could be advanced enough to be a separate library – I like things modular and atrament
already does a lot of different things.
I could imagine a solution with two canvases, you capture individual strokes on the top one, and copy them over to the bottom one on mouseup
.
My question is: if there was to be a separate package – how would atrament
have to change/what things would it need to expose in order for it to work?
from atrament.
I'm interested in working on undo/redo, as well as adding some additional drawing tools and features (like line simplifying). Would you prefer I add those in my own branch only (and if so , would you like me to rename it to prevent confusion), or would you like PRs for these things?
I think the two canvas thing you mention is how other tools manage. I think if we add more events into the Atrament drawing, then another tool could handle undo/redo. A bunch of what atrament.js
currently does is mouse management, which could be pushed into the mouse.js
so that the main file is mostly managing state and actual canvas drawing.
My overall goal is to use Atrament as the drawing component for an animation tool, with onionskinning and .gif export.
from atrament.
@dethe this is great to hear, your use case is really cool. I'd be up for discussing the extra features you're proposing. My goal with Atrament is to make sure it conforms to "do one thing and do it well", but we already have the concept of different drawing modes (draw, fill, erase) so other tools could make sense, too.
I think we can treat undo/redo as a separate feature & track it in this issue, and discuss additional drawing tools separately. If you're willing to collaborate on these, I'd be happy to add you as a co-author. Could you please drop me an email (on my GH profile) about the new features you were envisaging?
thanks, Jakub
from atrament.
Hi folks, just FYI Undo/redo is now possible to implement with Atrament 1.0.0 - see README, there is now a recordStrokes
option and a strokerecorded
event. Using the stroke data you should be able to store all strokes and redraw them as needed.
from atrament.
Related Issues (20)
- 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
- Click creates a line in top left corner 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 atrament.