File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11{
22 "name" : " Budibase-Signature-Plugin" ,
3- "version" : " 1.2.5 " ,
3+ "version" : " 1.2.7 " ,
44 "description" : " A plugin that allows signatures to be created and saved in budibase" ,
55 "license" : " MIT" ,
66 "svelte" : " index.js" ,
Original file line number Diff line number Diff line change 4848
4949 const handleStart = (({ offsetX: x, offsetY: y }) => {
5050 if (! inBuilder){
51+ const { top , left } = canvas .getBoundingClientRect ()
52+ t = top
53+ l = left
5154 if (color === background) {
5255 context .clearRect (0 , 0 , width, height)
5356 } else {
6669
6770 const handleMove = (({ offsetX: x1, offsetY: y1 }) => {
6871 if (! inBuilder){
72+ const { top , left } = canvas .getBoundingClientRect ()
73+ t = top
74+ l = left
6975 if (! isDrawing) return
7076
7177 const { x , y } = start
72- context .beginPath ()
73- context .moveTo (x, y)
74- context .lineTo (x1, y1)
75- context .closePath ()
76- context .stroke ()
77-
78+
79+ if (x >= 0 ){
80+ if (y >= 0 ){
81+ context .beginPath ()
82+ context .moveTo (x, y)
83+ context .lineTo (x1, y1)
84+ context .closePath ()
85+ context .stroke ()
86+ }
87+ }
88+
7889 start = { x: x1, y: y1 }
7990 }
8091 })
161172 style:background
162173 bind:this ={canvas }
163174 on:mousedown ={handleStart }
164- on:touchstart ={e => {
175+ on:touchstart | preventDefault ={e => {
165176 const { clientX, clientY } = e .touches [0 ]
166177 handleStart ({
167178 offsetX: clientX - l ,
You can’t perform that action at this time.
0 commit comments