react-canvas-draw icon indicating copy to clipboard operation
react-canvas-draw copied to clipboard

Support for pressure considered?

Open anilgulecha opened this issue 4 years ago • 4 comments

Pls consider adding pressure based thickness support. Touch events can indicate the pressure on the drawing (which can be used to set the size of point/line/curve drawn).

Eg: https://patrickhlauke.github.io/touch/tracker/tracker-force-pressure.html https://viliusle.github.io/miniPaint/

This would make the component quite versatile.

anilgulecha avatar Sep 12 '21 08:09 anilgulecha

This honestly would make this program perfect! I actually came here to suggest this.

Would be awesome!

sifatdipta avatar Nov 08 '21 03:11 sifatdipta

Should be a low-hanging fruit to add using https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/pressure, right?

embiem avatar Nov 08 '21 09:11 embiem

Should be a low-hanging fruit to add using https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/pressure, right?

Yeah I believe so, you can also look into https://github.com/stuyam/pressure

sifatdipta avatar Nov 08 '21 15:11 sifatdipta

Would adding a eraser mode be too difficult? I was playing with your codes earlier to come up with a solution for both pressure and eraser mode.

sifatdipta avatar Nov 08 '21 15:11 sifatdipta