X-Git-Url: https://git.plutz.net/?p=confetti;a=blobdiff_plain;f=static%2Ftherapy_draw.js;h=5a06728683532f1888753042794ab06bf8c79b3e;hp=0b5dffa0366c9fd259ee09c13588458e83076869;hb=da08149f6cdeb8fea9cc89fde75e4aab84cbcfd8;hpb=7107c9052dc7c6d82d75e94842ef9578f1e2a556 diff --git a/static/therapy_draw.js b/static/therapy_draw.js index 0b5dffa..5a06728 100644 --- a/static/therapy_draw.js +++ b/static/therapy_draw.js @@ -35,10 +35,9 @@ function setcol(c) { image.fillStyle = c if ( c == "#FFF" ) image.lineWidth = 32 else image.lineWidth = 4 - data.value += " stroke " + c + " stroke-width " + image.lineWidth + data.value += " stroke " + c + "F" + " stroke-width " + image.lineWidth } -setcol("$tpy[color]") function relX(x){ if ( body.clientWidth >= 800 ){ @@ -74,6 +73,10 @@ function drawstart(x, y) { stx=relX(x), sty=relY(y) + document.getElementsByName("color").forEach( + function(x, y, z){ if (x.checked) setcol(x.value); } + ); + image.beginPath() draw(x, y) // why must this not use relative Coords ???