Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to deal with touchstart - touchmove - touchend ? #66

Closed
Kamoba opened this issue Aug 21, 2021 · 2 comments · Fixed by #70
Closed

How to deal with touchstart - touchmove - touchend ? #66

Kamoba opened this issue Aug 21, 2021 · 2 comments · Fixed by #70

Comments

@Kamoba
Copy link

Kamoba commented Aug 21, 2021

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.

@ayhanap
Copy link

ayhanap commented Jun 7, 2022

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

@nedredmond
Copy link
Contributor

@Kamoba You should be able to use pointerdown and pointerup

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants