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

Pressure sensitivity #136

Open
blurymind opened this issue Apr 5, 2021 · 0 comments
Open

Pressure sensitivity #136

blurymind opened this issue Apr 5, 2021 · 0 comments

Comments

@blurymind
Copy link

Web api's allow to get pressure sensitivity data from the PointerEvent (event.pressure). That can be used to drive line thickness, which makes a huge difference when you use a samsung galaxy note device for example.
My findings were that one must enable pointer events first

See Fabricjs got this a while back in 3.0.0
Canvas.enablePointerEvents

someone also wrote a brush that uses it,since the ordinary one doesnt have varied thickness it seems
fabricjs/fabric.js#4885
https://research.archinc.jp/fabricjs-psbrush/

fabric also has a pencilbrush, although not sure if it has point thickness/opacity which pressure can use
http://fabricjs.com/docs/fabric.PencilBrush.html

outside of fabricjs there are a few examples of this such as
https://github.com/amoshydra/draw

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

No branches or pull requests

1 participant