Emmanuel Gabion
Emmanuel Gabion

Reputation: 425

Undo/Redo functionality in CamanJS?

Hi Im a newbie in camanjs.

I manipulate canvas with this code.

        function vintage(id){
    Caman(id, function(){

    //I just added this code to reset the canvas to its original state
    this.revert();
    //----------------------------

    this.vintage();
    this.render();

    });
    } 

With the code this.revert(); , I can turn the canvas back to its original state. What if I use multiple effects and presets and just I want to revert the canvas few steps back to my last used effect?

Upvotes: 2

Views: 642

Answers (1)

bobbdelsol
bobbdelsol

Reputation: 1006

I don't see a way to do that, but you can stash the canvas in a hidden span, and then replace it as part of an undo chain.

use clone to stash it

Upvotes: 1

Related Questions