op/clip: add note about Path.End

Signed-off-by: Egon Elbre <egonelbre@gmail.com>
This commit is contained in:
Egon Elbre
2024-04-15 11:07:14 +03:00
committed by Elias Naur
parent ee6cdec60b
commit 3b5148a64e
+3
View File
@@ -138,6 +138,9 @@ type Path struct {
func (p *Path) Pos() f32.Point { return p.pen } func (p *Path) Pos() f32.Point { return p.pen }
// Begin the path, storing the path data and final Op into ops. // Begin the path, storing the path data and final Op into ops.
//
// Caller must also call End to finish the drawing.
// Forgetting to call it will result in a "panic: cannot mix multi ops with single ones".
func (p *Path) Begin(o *op.Ops) { func (p *Path) Begin(o *op.Ops) {
*p = Path{ *p = Path{
ops: &o.Internal, ops: &o.Internal,