CamanJS中的撤消/重做功能



嗨,我是camanjs的新手。

我用这段代码操纵画布。

        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();
    });
    } 

使用代码 this.revert(); ,我可以将画布恢复到其原始状态。如果我使用多个效果和预设,而只想将画布恢复到上次使用的效果,该怎么办?

我看不到这样做的方法,但是您可以将画布隐藏在隐藏的范围内,然后将其作为撤消链的一部分进行替换。

使用克隆将其存储

最新更新