diff --git a/app/javascript/elements/signature_form.js b/app/javascript/elements/signature_form.js index 535fc8a6..55020081 100644 --- a/app/javascript/elements/signature_form.js +++ b/app/javascript/elements/signature_form.js @@ -5,8 +5,12 @@ export default targetable(class extends HTMLElement { static [target.static] = ['canvas', 'input', 'clear', 'button'] async connectedCallback () { - this.canvas.width = this.canvas.parentNode.parentNode.clientWidth - this.canvas.height = this.canvas.parentNode.parentNode.clientWidth / 3 + const scale = 3 + + this.canvas.width = this.canvas.parentNode.clientWidth * scale + this.canvas.height = this.canvas.parentNode.clientHeight * scale + + this.canvas.getContext('2d').scale(scale, scale) const { default: SignaturePad } = await import('signature_pad') diff --git a/app/views/user_initials/edit.html.erb b/app/views/user_initials/edit.html.erb index 08a67d31..84bb1c9d 100644 --- a/app/views/user_initials/edit.html.erb +++ b/app/views/user_initials/edit.html.erb @@ -16,7 +16,7 @@ <%= form_for @user_config, url: user_initials_path, method: :put, data: { turbo_frame: :_top }, html: { autocomplete: :off, enctype: 'multipart/form-data' } do |f| %> Clear - +
<%= f.button button_title(title: 'Save', disabled_with: 'Saving'), class: 'base-button', data: { target: 'signature-form.button' } %> diff --git a/app/views/user_signatures/edit.html.erb b/app/views/user_signatures/edit.html.erb index cd60e4be..53822ce6 100644 --- a/app/views/user_signatures/edit.html.erb +++ b/app/views/user_signatures/edit.html.erb @@ -16,7 +16,7 @@ <%= form_for @user_config, url: user_signature_path, method: :put, data: { turbo_frame: :_top }, html: { autocomplete: :off, enctype: 'multipart/form-data' } do |f| %> Clear - +
<%= f.button button_title(title: 'Save', disabled_with: 'Saving'), class: 'base-button', data: { target: 'signature-form.button' } %>