All Projects → magicien → undo-canvas

magicien / undo-canvas

Licence: MIT license
Add undo/redo functions to CanvasRenderingContext2D

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to undo-canvas

actions
Software without side-effects. Redo and Undo.
Stars: ✭ 23 (-30.3%)
Mutual labels:  undo-redo
js-undo-manager
Simple JavaScript undo/redo command manager supporting transactions with no dependencies
Stars: ✭ 23 (-30.3%)
Mutual labels:  undo-redo
Regret
[Moved to MavenCentral] An undo-redo Android library which works with any objects and with an easy implementation. Perfect for drawing, text and photo editing apps.
Stars: ✭ 65 (+96.97%)
Mutual labels:  undo-redo
undoredo-cpp
Some concepts of Undo/Redo attempted in C++03
Stars: ✭ 20 (-39.39%)
Mutual labels:  undo-redo
Sublundo
A Sublime Text 3 package implementing Vim-like branching undo/redo.
Stars: ✭ 16 (-51.52%)
Mutual labels:  undo-redo
old-fashioned-donut
a programming language for time leapers
Stars: ✭ 17 (-48.48%)
Mutual labels:  undo-redo
UndoRedo.js
A powerful and simple JavaScript library provides a history for undo/redo functionality. Just like a time machine! 🕐
Stars: ✭ 19 (-42.42%)
Mutual labels:  undo-redo

undo-canvas

Add undo/redo functions to CanvasRenderingContext2D

Online Demo 1 / Demo 2

<script src="https://cdn.rawgit.com/magicien/undo-canvas/v0.1.3/undo-canvas.js"></script>
<script>
const canvas = document.createElement('canvas')
const context = canvas.getContext('2d')
UndoCanvas.enableUndo(context)

context.strokeStyle = '#ff0000'
context.beginPath()
context.moveTo(0, 0)
context.lineTo(30, 30)
context.closePath()
context.stroke()

context.undo() // erase the line

context.redo() // redraw the line

UndoCanvas.disableUndo(context)
</script>

Install

Node

npm install --save undo-canvas

Browser

<script src="https://cdn.rawgit.com/magicien/undo-canvas/v0.1.3/undo-canvas.js"></script>
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].