2

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?

Emmanuel Gabion
  • 425
  • 1
  • 9
  • 20

1 Answers1

1

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

bobbdelsol
  • 996
  • 6
  • 21