PathKt

Added in 1.1.0

public final class PathKt


Summary

Public methods

static final @NonNull Path
and(@NonNull Path receiver, @NonNull Path p)

Returns the intersection of two paths as a new Path.

static final @NonNull Iterable<@NonNull PathSegment>
@RequiresApi(value = 26)
flatten(@NonNull Path receiver, float error)

Flattens (or approximate) the Path with a series of line segments.

static final @NonNull Path
minus(@NonNull Path receiver, @NonNull Path p)

Returns the difference of two paths as a new Path.

static final @NonNull Path
or(@NonNull Path receiver, @NonNull Path p)

Returns the union of two paths as a new Path.

static final @NonNull Path
plus(@NonNull Path receiver, @NonNull Path p)

Returns the union of two paths as a new Path.

static final @NonNull Path
xor(@NonNull Path receiver, @NonNull Path p)

Returns the union minus the intersection of two paths as a new Path.

Public methods

and

public static final @NonNull Path and(@NonNull Path receiver, @NonNull Path p)

Returns the intersection of two paths as a new Path. If the paths do not intersect, returns an empty path.

flatten

@RequiresApi(value = 26)
public static final @NonNull Iterable<@NonNull PathSegmentflatten(@NonNull Path receiver, float error)

Flattens (or approximate) the Path with a series of line segments.

Parameters
float error

The acceptable error for a line on the Path in pixels. Typically this would be 0.5 so that the error is less than half a pixel. This value must be positive and is set to 0.5 by default.

See also
approximate

minus

public static final @NonNull Path minus(@NonNull Path receiver, @NonNull Path p)

Returns the difference of two paths as a new Path.

or

public static final @NonNull Path or(@NonNull Path receiver, @NonNull Path p)

Returns the union of two paths as a new Path.

plus

public static final @NonNull Path plus(@NonNull Path receiver, @NonNull Path p)

Returns the union of two paths as a new Path.

xor

public static final @NonNull Path xor(@NonNull Path receiver, @NonNull Path p)

Returns the union minus the intersection of two paths as a new Path.