svg.draw.js icon indicating copy to clipboard operation
svg.draw.js copied to clipboard

How to deal with touchstart - touchmove - touchend ?

Open Kamoba opened this issue 4 years ago • 1 comments

I'm using it for drawing with mouse (draw.polyline()) on a TouchDevice (Window tablet) and it's not working, not geting the event mousedown and mouseup, so i replace them with touchstart and touchend but gor error:

Uncaught TypeError: SVGPoint.x setter: Value being assigned is not a finite floating-point value.

Code:

    draw.on('mousedown', event => { 
      const shape = getDrawObject();
      shapes[index] = shape;
      shape.draw(event);
    });

but work on pc.

Kamoba avatar Aug 21 '21 09:08 Kamoba

I was checking this too but as I understand current library doesn't support touch events. Because coordinates in touch events are at e.changedTouches[0].clientX instead of the current code which only uses e.clientX

ayhanap avatar Jun 07 '22 09:06 ayhanap