common fill: add fill-rule interface.
authorHermet Park <chuneon.park@samsung.com>
Tue, 20 Oct 2020 10:36:26 +0000 (19:36 +0900)
committerHermet Park <chuneon.park@samsung.com>
Thu, 22 Oct 2020 06:05:03 +0000 (15:05 +0900)
commit2c0cb6ef869eb7f07a98e20ccc290448d81c69e9
tree8a4e64c6d767f2487426bdaaa58e6c6c7d1661a4
parentc7dc7868a9dece2ecb8454e70ee7076fc056eec8
common fill: add fill-rule interface.

Fill rule is used to select how paths are filled.

For both fill rules, wheter or not a point is included in the fill is determined by taking a ray
from that point to infinity and looking at intersections with the path. The ray can be in any
direction, as long as it doens't pass through the end point of a segment or have a tricky
intersection such as intersecting tangent to the path.

@API Addtions:

enum class TVG_EXPORT FillRule { Winding = 0, EvenOdd };
Result Fill::rule(FillRule r) noexcept;
FillRule Fill::rule() const noexcept;

@Examples:

shape->rule(FillRule::EvenOdd);

@issue: 97

Change-Id: Ia282acd5f9d6154216683c1a65369a9a48220544
inc/thorvg.h
src/lib/tvgFill.cpp
src/lib/tvgShape.cpp
src/lib/tvgShapeImpl.h