DrawerJs icon indicating copy to clipboard operation
DrawerJs copied to clipboard

Standalone DrawerJS using API touch pen issue

Open brianm85 opened this issue 5 years ago • 3 comments

Using the API example, it doesn't allow the pen from a touch device to draw, only a mouse. Am I missing a config setting or is it designed this way

brianm85 avatar Dec 07 '20 08:12 brianm85

Same question... EDIT : i think it's a question of coordinates captured on touch : if i put the canvas div "up" on the body (by hidding previous divs in the api exemple page), it works...

artmediaweb avatar Jan 19 '21 14:01 artmediaweb

Anyone had any luck correcting this? Seems to be an issue on the iPad Pro using an Apple Pencil.

MatthewHolmes avatar May 24 '21 23:05 MatthewHolmes

I know the issue is old but maybe this will help you. Had the same issue with pencils on Windows Tablets. It seems to be an issue with fabric. You need to add one check in fabric.1.7.22.min.js for isTouchSupported - navigator.maxTouchPoints > 1

fabric.isTouchSupported="ontouchstart" in fabric.document.documentElement||navigator.maxTouchPoints>1;

Remember to save without formatting so the minified file stays minified.

This helped us in our app, hopefully it will work for you as well ;)

hawelkam avatar Aug 10 '23 12:08 hawelkam