Closed fskpf closed 8 months ago
Wow this is a weird bug. Thanks for reporting it. Will update soon.
The current scan-line algorithm doesn't work well with fractions. It can be fixed if needed. but for now I have updated Rough. to round the gap to the nearest integer. Since line-fills are always calculated in 1 pixel units you wouldn't notice any difference considering the roughness. involved. Resolved with https://github.com/rough-stuff/rough/pull/222 Rough version 4.6.6 published
For hachureGap values of
1.6
,1.7
, or presumably fractions other thanx.5
or integers, the hachure fill is randomly missing in the result.For example, test this fiddle: https://jsfiddle.net/d7xjk5qb/ (run it multiple times). Note the
hachureGap
value. Changing it to an integer orx.5
values makes it work consistently.I'm not sure about the
hachureGap
option anyway. The documentation states that it is a numerical value, but also states that it is the average pixel distance of the lines (guessinginteger
here?). Looking at the hachure-fill implementation the hachureGap is at least clamped to a minimum of0.1
, so I guess fractions should work in general.