john_hancock icon indicating copy to clipboard operation
john_hancock copied to clipboard

Option to clear the canvas

Open Tressa-Sanders opened this issue 5 years ago • 2 comments

Hi! Any way to add and option to "clear" the canvas like the current signature-pad?

Tressa-Sanders avatar Sep 14 '20 20:09 Tressa-Sanders

I worked it out. I forked the gem and added this to the bottom of the john_hancock.js

function signatureClear() {
  var canvas = document.getElementById("JohnHancock-canvas");
  var context = canvas.getContext("2d");
  context.clearRect(0, 0, canvas.width, canvas.height);
}

Then I used this button code: <button type="button" onclick="signatureClear()">Clear</button>

Tressa-Sanders avatar Sep 17 '20 21:09 Tressa-Sanders

Want to open a PR to make this function available?

Brantron avatar Dec 02 '21 18:12 Brantron