tweaking signature frame

This commit is contained in:
Jonathan Jenne
2023-12-12 16:10:30 +01:00
parent 8581cb555a
commit 0dfc9b4f09
2 changed files with 5 additions and 10 deletions

View File

@@ -115,15 +115,9 @@
console.log(receiverSignature)
//canvas.width = width
//canvas.height = height
canvas.width = width * scale
canvas.height = height * scale
//canvas.style.width = width * 4
//canvas.style.height = height * 4
const ctx = canvas.getContext('2d')
// This supposedly makes the lines and text less blurry
// See: https://stackoverflow.com/questions/8696631/canvas-drawings-like-lines-are-blurry
@@ -133,7 +127,7 @@
ctx.textRendering = "geometricPrecision"
const date = new Date()
const dateString = date.toLocaleDateString('de-DE')
const dateString = date.toLocaleString('de-DE')
const signatureLength = 100 * scale
@@ -157,7 +151,8 @@
ctx.fillStyle = 'black'
ctx.font = `${fontSize * scale}px sans-serif`
ctx.fillText('Signed by', 30 * scale, 10 * scale)
ctx.fillText(receiverName + ', ' + dateString, 15 * scale, 60 * scale)
ctx.fillText(receiverName, 15 * scale, 60 * scale)
ctx.fillText(dateString, 15 * scale, 70 * scale)
return new Promise((resolve) => {
canvas.toBlob((blob) => {