I've been trying to create an undo function that would remove the last segment from my path in paper.js. I'm having trouble because the function expects an index, but I can't seem to get one. I've tried:
undo: function(){
path.removeSegment(path.segments.lastsegment);
path.removeSegment(path.segments.lastsegment.index);
path.segments.lastsegment.remove;
},
and more... None seem to work. Has anyone done this with paper function instead of making your own index? Thanks!