CompositePath

class CompositePath

A CompositePath is a path composed of one or more subpaths. Composite paths in Flow are stored in normalized coordinates, that is they fit within a unit square.

  • true if this composite path does not contain any subpaths, false.

    Declaration

    var isEmpty: Bool { get }
  • The list of subpaths contained in this composite path.

    Declaration

    var paths: Array { get }
  • An ordered list containing all the points of all the subpaths of the compostie path.

    Declaration

    var points: Array { get }
  • The object’s description

    Declaration

    var description: String { get }
  • Compares two values for equality.

    The equals function is invoked using infix notation as in the following code snippet: lhs == rhs.

    Declaration

    func equals(_ lhs: CompositePath) -> Bool

    Parameters

    lhs

    A value.

    rhs

    Another value.

    Return Value

    true if the lhs and rhs are equal, false otherwise.

  • Converts the composite path to an SVG path string containing only cubic bezier curve commands.

    Before being converted to an SVG path, the composite path is first scaled to fit within the size size. The generated SVG string path contains exclusively cubic bezier curve commands.

    Declaration

    func svgc(size: Size) -> String

    Parameters

    size

    The size of the bounding box containing the resulting SVG path.

    Return Value

    An SVG path string representing the composite path.

  • Converts the composite path to an SVG path string.

    Before being converted to an SVG path, the composite path is first scaled to fit within the size size. The generated SVG string path may contain any of the SVG path commands.

    Declaration

    func svg(size: Size) -> String

    Parameters

    size

    The size of the bounding box containing the resulting SVG path.

    Return Value

    An SVG path string representing the composite path.

  • Creates a new path scaled to the given size where all corner radii are converted to normal bezier curves.

    Declaration

    func render(size: Size) -> CompositePath

    Parameters

    size

    The size of the bounding box containing the resulting path.

    Return Value

    The newly created path that has been scaled and whose corner radii have been rendered.