Join us on the livestream at Android Dev Summit on 7-8 November 2018, starting at 10AM PDT!

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

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

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>