Skip to content

Commit 11961ef

Browse files
committed
add vgerCancelPath
1 parent 3cc5acf commit 11961ef

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

Sources/vger/include/vger.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,11 @@ void vgerCubicApproxTo(vgerContext vg, vector_float2 b, vector_float2 c, vector_
152152
/// Returns false if there were too many primitives to render the fill.
153153
bool vgerFill(vgerContext, vgerPaintIndex paint);
154154

155+
/// Clear path information.
156+
///
157+
/// This is useful for ensuring scripts don't mess up other rendering.
158+
void vgerCancelPath(vgerContext vg);
159+
155160
#pragma mark - Transforms
156161

157162
/// Translates current coordinate system.

Sources/vger/vger.mm

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -887,6 +887,10 @@ bool vgerFill(vgerContext vg, vgerPaintIndex paint) {
887887
return vg->fill(paint);
888888
}
889889

890+
void vgerCancelPath(vgerContext vg) {
891+
vg->yScanner.segments.clear();
892+
}
893+
890894
void vgerEncode(vgerContext vg, id<MTLCommandBuffer> buf, MTLRenderPassDescriptor* pass) {
891895
vg->encode(buf, pass, false);
892896
}

0 commit comments

Comments
 (0)