arch-inc / fabricjs-psbrush

Fabric.js用の感圧ブラシ実装 / A lightweight pressure-sensitive brush implementation for Fabric.js
https://arch-inc.github.io/fabricjs-psbrush/
Other
62 stars 24 forks source link

Line segments with different pressure don't have a fluent transition if drawn fast #8

Open retat opened 4 years ago

retat commented 4 years ago

photo5199765031384887068

I used an iPad pro on the provided demo page for the effect in the screenshot. Is there a possible solution?

arcatdmz commented 4 years ago

Hi @retat, thanks for your feedback!

The ladder-like transition is caused because each stroke is just a series of line segments with varying widths. So, there is no fundamental fix.

Meanwhile, a stroke is simplified when you finish drawing a stroke, and how it gets simplified can be tweaked by changing the parameter: you could increase the value of PSBrush.pressureCoeff to put more value on pressure changes than {x, y} changes.

retat commented 4 years ago

Thanks for the answer. I tried tweaking the pressureCoeff value but as far as I can see it doesn't make a difference. Is there a specific value that I should try?