kamranahmedse/brusher

Mobile browser support?

la55u opened this issue · 1 comments

la55u commented

Thanks for this great library. Is there a way to support mobile devices? Like drawing a line on the background instead of hovering...

You could edit bind().
Currently:

document.addEventListener("mousemove", (e) => {
      if (!e.clientX || !e.clientY) {
        return;
      }
      ... drawing trail

It's using the event listener mousemove and then drawing the tail. You could play around with modifying that.