PathMeasure

Constructors

Link copied to clipboard
constructor()
constructor(path: Path?, forceClosed: Boolean = false, resScale: Float = 1.0f)

Initialize the pathmeasure with the specified path. The parts of the path that are needed are copied, so the client is free to modify/delete the path after this call.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open override val isClosed: Boolean
Link copied to clipboard

Return the total length of the current contour, or 0 if no path is associated (e.g. resetPath(null))

Functions

Link copied to clipboard
expect open fun close()

Free underlying native resource, peer is useless afterwards.

Link copied to clipboard
fun getMatrix(distance: Float, getPosition: Boolean, getTangent: Boolean): Matrix33?

Pins distance to 0 <= distance <= getLength(), and then computes the corresponding matrix (by calling getPosition/getTangent).

Link copied to clipboard
fun getPosition(distance: Float): Point?

Pins distance to 0 <= distance <= getLength(), and then computes the corresponding position.

Link copied to clipboard
fun getRSXform(distance: Float): RSXform?

Pins distance to 0 <= distance <= getLength(), and then computes the corresponding RSXform.

Link copied to clipboard
fun getSegment(startD: Float, endD: Float, dst: Path, startWithMoveTo: Boolean): Boolean

Given a start and stop distance, return in dst the intervening segment(s). If the segment is zero-length, return false, else return true. startD and stopD are pinned to legal values (0..getLength()). If startD > stopD then return false (and leave dst untouched). Begin the segment with a moveTo if startWithMoveTo is true

Link copied to clipboard
fun getTangent(distance: Float): Point?

Pins distance to 0 <= distance <= getLength(), and then computes the corresponding tangent.

Link copied to clipboard

Move to the next contour in the path. Return true if one exists, or false if we're done with the path.

Link copied to clipboard
fun setPath(path: Path?, forceClosed: Boolean): PathMeasure

Reset the pathmeasure with the specified path. The parts of the path that are needed are copied, so the client is free to modify/delete the path after this call.

Link copied to clipboard
expect open override fun toString(): String