X-Git-Url: https://git.plutz.net/?p=confetti;a=blobdiff_plain;f=static%2Ftherapy_draw.js;h=8a8e936c6873b443a0d7ba0799b491e7f5d50f7e;hp=8266ac50d3429ff394169a918fbde0aadbb10a2e;hb=e75e1486ac6903578fbc20fdcea659412cb3866f;hpb=e4a974a6b990f9f5fb521303b82ef6289f6027fa diff --git a/static/therapy_draw.js b/static/therapy_draw.js index 8266ac5..8a8e936 100644 --- a/static/therapy_draw.js +++ b/static/therapy_draw.js @@ -74,12 +74,8 @@ function drawstart(x, y) { stx=relX(x), sty=relY(y) - document.getElementsByName("penwidth").forEach( - function(x, y, z){ if (x.checked) setstroke(x.value); } - ); - document.getElementsByName("color").forEach( - function(x, y, z){ if (x.checked) setcol(x.value); } - ); + 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 ???