rough-stuff / rough

Create graphics with a hand-drawn, sketchy, appearance
http://roughjs.com
MIT License
19.83k stars 613 forks source link

added option to choose number of curve draws #134

Closed bjoernbg closed 4 years ago

bjoernbg commented 4 years ago

Hey there! I love your library, great work! I noticed that the curve() method was hard-coded to always draw lines twice, which is a nice "rough" look. But I need a cleaner look with just one line, so I added this as an option: curveBackAndForth: 1 – that way, the user can specify how many lines should be drawn. Specifying 2results in the same as before, but you can also go higher as illustrated in the screenshot (examples showing curveBackAndForth: 1, curveBackAndForth: 2 and curveBackAndForth: 5 from left to right).

image
pshihn commented 4 years ago

Sorry for not looking at this sooner. but I am not sure adding another property is the correct answer here. We need to find a way to configure curves so they are righter for the n=1 case. for n > 1 They client of the lib can call the curve n times with the same value.

Creating a new issue https://github.com/pshihn/rough/issues/147 to discuss/deal with this