fskpf / svg2roughjs

Create sketchy, hand-drawn-like images from SVGs
https://fskpf.github.io/
MIT License
158 stars 13 forks source link

hachure fill is missing sometimes #98

Closed fskpf closed 1 year ago

fskpf commented 1 year ago

When randomize is enabled, the hachure fill is missing sometimes.

For example, test this fiddle: https://jsfiddle.net/d7xjk5qb/ (run it multiple times) which reproduces it directly with Roughjs. Note the hachureGap value. Changing it to integer or .5 values makes it work.

According to Roughjs hachureGap is a numerical value that describes the average distance in pixels and the hachure-fill implementation assumes integer values ((iteration % gap === 0)).

There, svg2roughjs should make sure to use random integer values here.