Closed ygra closed 4 years ago
can you share an example? it should be even-odd already
https://jsfiddle.net/ck8z6eh4/ Looks non-zero to me. Perhaps because it's two sub-paths where the latter forms the hole, instead of a single sub-path intersecting itself?
Using a different path (taken from the SVG spec), winding direction indeed makes a difference, indicating non-zero-ness:
fill-rule=evenodd
fill-rule=nonzero
Yes I do realize the difference. Should definitely fix this Just for notes, few things to consider here: 1) The SVG 'path' fill algorithm at the moment is different than that from other shapes. 2) Is it something that rough should set or should the called set it before drawing the shape - this depends on 1 3) Consider the implementation for Canvas Vs SVG
I have developed a new algorithm for path filling. Hopefully implement it in the next couple of days.
Independent of the new algorithm, fixed the evenodd issue in v4.1.3 https://jsfiddle.net/wytpsLr6/2/
This problem still exists when using https://unpkg.com/roughjs@4.3.1/bundled/rough.js
Is there an option for even-odd? Otherwise paths with holes are pretty impossible to draw