]> git.plutz.net Git - lobster/blobdiff - therapies/therapy_draw.js
Bugfix: fix crash in escape and unescape function when handling patterns like foo...
[lobster] / therapies / therapy_draw.js
index 8a8e936c6873b443a0d7ba0799b491e7f5d50f7e..604c000de3810e01f8d10d41dcdefdfb1b791eda 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright 2016 Paul Hänsch
+// Copyright 2016, 2020 Paul Hänsch
 //
 // This file is part of Confetti.
 // 
@@ -77,16 +77,16 @@ function drawstart(x, y) {
   setstroke(document.querySelector('input[name="penwidth"]:checked').value);
   setcol(document.querySelector('input[name="color"]:checked').value);
 
-  image.beginPath()
-  draw(x, y)  // why must this not use relative Coords ???
+  image.beginPath();
+  draw(x, y);  // why must this not use relative Coords ???
 
-  image_serialize = " polyline"
+  image_serialize = " polyline " + stx + "," + sty;
 }
 
 function drawstop() {
  
   // if path ends close to beginning ( < 50 px); then close path and fill
-  if ( false && mouse == 1 && Math.sqrt( Math.pow(stx - cux, 2) + Math.pow(sty - cuy, 2)) <= 50 && c !== "#FFF" ){
+  if ( mouse == 1 && Math.sqrt( Math.pow(stx - cux, 2) + Math.pow(sty - cuy, 2)) <= 50 && c !== "#FFF" ){
     image.lineTo( stx, sty )
     image.stroke()