wulfsolter / angular2-signaturepad

Angular2 Component for szimek / signature_pad
MIT License
176 stars 157 forks source link

Undo action #54

Closed stojankukrika closed 6 years ago

stojankukrika commented 6 years ago

Hi, I find that exists clear method, is there action for undo the last draw?

lathonez commented 6 years ago

Nope

stojankukrika commented 6 years ago

Did you plain to build it?

lathonez commented 6 years ago

This component is a wrapper for szimek/signature_pad

API is identical to szimek/signature_pad

Options are as per szimek/signature_pad

Thus if you feel an "action for undo the last draw" feature would be useful, you need to raise an issue in the upstream repo.

The upstream repo is szimek/signature_pad

stojankukrika commented 6 years ago

It's Ok bro, I see that. There I see that exists there https://jsfiddle.net/szimek/osenxvjc/ that is the reason why ask will you do that?

stojankukrika commented 6 years ago

If someone needs undo and clear methods: ` drawUndo() { this.have_signed = false; let data = this.signaturePad.toData(); if (data) { data.pop(); this.signaturePad.fromData(data); } }

drawClear() {
    this.signaturePad.clear();
    this.have_signed = false;
}`
lathonez commented 6 years ago

@stojankukrika thanks a lot for the example. If you want to make a PR with this feature we could include it in the repo