Path Builder
PathBuilder is used to create immutable Path objects.
PathBuilder follows the builder pattern - all mutation methods return the builder instance for method chaining. Once path construction is complete, call detach to get an immutable Path object, or snapshot to get a copy while keeping the builder usable.
This class contains all path construction methods that were previously mutation methods on the Path class. Path objects created from PathBuilder are immutable.
Constructors
Properties
Functions
Adds circle centered at (x, y) of size radius to path.
Adds oval to path, appending MOVE, four CONIC, and CLOSE verbs.
Appends src path to this builder.
Appends src path transformed by matrix.
Appends src path offset by (dx, dy).
Adds contour created from line array.
Adds rectangle to path, appending MOVE, three LINE, and CLOSE verbs.
Adds rounded rectangle to path, creating a new closed contour.
Appends CLOSE verb to path. A closed contour connects the first and last point with line.
Adds cubic from last point towards point p1, then towards point p2, ending at point p3.
Adds cubic from last point towards (x1, y1), then towards (x2, y2), ending at (x3, y3).
Appends arc to path using point parameters.
Appends arc to path. Arc is implemented by one or more conics weighted to describe part of oval with radii (rx, ry) rotated by xAxisRotate degrees.
Hints to reserve additional space for approximately extraPtCount points and verbs. May improve performance by reducing allocations.
Adds line from last point to point p.
Adds line from last point to (x, y). If PathBuilder is empty, or last verb is CLOSE, last point is set to (0, 0) before adding line.
Adds beginning of contour at point p.
Adds beginning of contour at point (x, y).
Offsets all points in this builder by (dx, dy).
Appends arc to path, relative to last point.
Resets the builder to empty, removing all verbs, points, and weights. Fill type is reset to WINDING.
Adds line from last point to vector (dx, dy). If PathBuilder is empty, or last verb is CLOSE, last point is set to (0, 0) before adding line. Line end is last point plus vector (dx, dy).
Adds beginning of contour relative to last point. If PathBuilder is empty, starts contour at (dx, dy). Otherwise, start contour at last point offset by (dx, dy).
Sets the fill type for paths created from this builder.
Sets last point to (x, y).
Appends arc to path, after appending line if needed.
Appends arc to path, after appending line if needed. Arc is contained by tangent from last point to (x1, y1), and tangent from (x1, y1) to (x2, y2).
Transforms this builder by matrix.