added in version 1.0.0
belongs to Maven artifact androidx.core:core:1.0.0-beta01

PathUtils

public final class PathUtils
extends Object

java.lang.Object
   ↳ androidx.core.graphics.PathUtils


A set of path-related utility methods.

Summary

Public methods

static Collection<PathSegment> flatten(Path path)

Flattens (or approximate) a Path with a series of line segments using a 0.5 pixel error.

static Collection<PathSegment> flatten(Path path, float error)

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

Inherited methods

Public methods

flatten

added in version 1.0.0
public static Collection<PathSegment> flatten (Path path)

Flattens (or approximate) a Path with a series of line segments using a 0.5 pixel error. Note: This method requires API 26 or newer.

Parameters
path Path

Returns
Collection<PathSegment>

flatten

added in version 1.0.0
public static Collection<PathSegment> flatten (Path path, 
                float error)

Flattens (or approximate) a Path with a series of line segments. Note: This method requires API 26 or newer.

Parameters
path Path

error float: The acceptable error for a line on the Path. Typically this would be 0.5 so that the error is less than half a pixel.

Value is 0.0 or greater.

Returns
Collection<PathSegment>