Ensure canvas size is restricted. devicePixelRatio was used to scale the canvas for devices with higher DPI screens only affecting macs

This commit is contained in:
Dean 2024-05-16 10:54:06 +01:00
parent 6b1e6c61fe
commit 2a95bc8457
1 changed files with 9 additions and 1 deletions

View File

@ -149,7 +149,11 @@
{/if}
{:else}
<div bind:this={canvasWrap} class="canvas-wrap">
<canvas id="signature-canvas" bind:this={canvasRef} />
<canvas
id="signature-canvas"
bind:this={canvasRef}
style="--max-sig-width: {width}px; --max-sig-height: {height}px"
/>
{#if editable}
<div class="indicator-overlay">
<div class="sign-here">
@ -193,6 +197,10 @@
.signature img {
max-width: 100%;
}
#signature-canvas {
max-width: var(--max-sig-width);
max-height: var(--max-sig-height);
}
.signature.light img,
.signature.light #signature-canvas {
-webkit-filter: invert(100%);