Description

Path represents a geometric path in a drawing context. This is the basic unit of drawing: all drawing operations consist of forming a path, then stroking, filling, or clipping to that path. A path is an OS resource; you must explicitly free it when finished. Paths consist of multiple figures. Once you have added all the figures to a path, you must "end" the path to make it ready to draw with. TODO rewrite all that

Or more visually, the lifecycle of a Path is

p := NewPath()
for every figure {
	p.NewFigure(...) // or NewFigureWithArc
	p.LineTo(...)    // any number of these in any order
	p.ArcTo(...)
	p.BezierTo(...)
	if figure should be closed {
		p.CloseFigure()
	}
}
p.End()
// ...
dp.Context.Stroke(p, ...) // any number of these in any order
dp.Context.Fill(p, ...)
dp.Context.Clip(p)
// ...
p.Free() // when done with the path

A Path also defines its fill mode. (This should ideally be a fill parameter, but some implementations prevent it.) TODO talk about fill modes

Path is referenced in 1 repository

github.com/andlabs/ui