]> git.plutz.net Git - lobster/commitdiff
scrolling fixes for firefox, different stroke-width for erazer
authorpaul <paul@plutz.net>
Wed, 20 Apr 2016 14:37:50 +0000 (14:37 +0000)
committerpaul <paul@plutz.net>
Wed, 20 Apr 2016 14:37:50 +0000 (14:37 +0000)
svn path=/trunk/; revision=103

templates/therapy.html.sh

index f1c42ac7f98ebe1b7e16d6527b5ab100d71b68c2..eb93553fae7d3ca3163d4165b913f47aefdbc017 100755 (executable)
@@ -202,8 +202,9 @@ cat <<EOF
 
   function setcol(c) {
     image.strokeStyle = c
-    image.lineWidth = 2
-    image_serialize += " stroke " + c
+    if ( c == "#FFF" ) image.lineWidth = 32
+    else image.lineWidth = 4
+    image_serialize += " stroke " + c + " stroke-width " + image.lineWidth
   }
 
   setcol("$tpy[color]")
@@ -214,8 +215,8 @@ cat <<EOF
         sx=Math.floor(cscaleW * (x - canvas.offsetLeft))
         sy=Math.floor(cscaleH * (y - canvas.offsetTop))
       } else { 
-        sx=Math.floor(cscaleW * (x - canvas.offsetLeft + body.scrollLeft))
-        sy=Math.floor(cscaleH * (y - canvas.offsetTop + body.scrollTop))
+        sx=Math.floor(cscaleW * (x - canvas.offsetLeft + window.pageXOffset))
+        sy=Math.floor(cscaleH * (y - canvas.offsetTop + window.pageYOffset))
       }
       image.lineTo( sx, sy )
       image.stroke()