VectorComposite.FillRule
EnumFill rule for closed path regions; determines which points are "inside" when fill contours overlap or self-intersect.
- Snapchat: not supported
- SPECS: fully supported
- Camera Kit Web: not supported
- Camera Kit Mobile: not supported
- SnapchatNot supported — Available on SPECS only
- SPECSFully supported
- Camera Kit WebNot supported — Available on SPECS only
- Camera Kit MobileNot supported — Available on SPECS only
Since Lens Scripting v370
Fill rule for closed path regions; determines which points are "inside" when
fill contours overlap or self-intersect. Mirrors the SVG fill-rule
attribute. Pass to VectorCompositeBuilder#addPath.
Index
Example
var builder = VectorCompositeBuilder.create(256, 256);
var pathBuilder = VectorPathBuilder.create();
pathBuilder.moveTo(new vec2(0, 0));
pathBuilder.lineTo(new vec2(256, 0));
pathBuilder.lineTo(new vec2(128, 256));
var path = pathBuilder.build();
// Even-odd leaves nested contours as holes; NonZero is the SVG default.
builder.addPath(path, VectorPaint.solid(new vec4(1, 0, 0, 1)), VectorComposite.FillRule.EvenOdd);
Enumeration Members
EvenOdd
EvenOdd:
number
SPECS
Even-odd rule. A point is inside the fill if a ray from that point crosses the path boundary an odd number of times. Useful for shapes with "holes" formed by nested contours.
Since
Lens Scripting Version 370
NonZero
NonZero:
number
SPECS
Non-zero winding rule. A point is inside the fill if a ray from that point crosses the path boundary a non-zero net number of times (counting direction). This is the SVG default.
Since
Lens Scripting Version 370