PathMeasure

Known direct subclasses

Summary

Public functions

Offset
getPosition(distance: Float)

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

Cmn
Boolean
getSegment(
    startDistance: Float,
    stopDistance: Float,
    destination: Path,
    startWithMoveTo: Boolean
)

Given a start and stop distance, return in dst the intervening segment(s).

Cmn
Offset
getTangent(distance: Float)

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

Cmn
Unit
setPath(path: Path?, forceClosed: Boolean)

Assign a new path, or null to have none.

Cmn

Public properties

Float

The total length of the current contour, or 0 if no path is associated with this measure object.

Cmn

Extension functions

PathMeasure

Obtain a reference to skia PathMeasure type

android

Public functions

getPosition

fun getPosition(distance: Float): Offset

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

Parameters
distance: Float

The distance along the current contour to sample

Returns
Offset

Offset.Unspecified if there is no path set

getSegment

fun getSegment(
    startDistance: Float,
    stopDistance: Float,
    destination: Path,
    startWithMoveTo: Boolean = true
): 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.

getTangent

fun getTangent(distance: Float): Offset

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

Parameters
distance: Float

The distance along the current contour to sample

Returns
Offset

Offset.Unspecified if there is no path set

setPath

fun setPath(path: Path?, forceClosed: Boolean): Unit

Assign a new path, or null to have none.

Public properties

length

val lengthFloat

The total length of the current contour, or 0 if no path is associated with this measure object.

Extension functions

asSkiaPathMeasure

fun PathMeasure.asSkiaPathMeasure(): PathMeasure

Obtain a reference to skia PathMeasure type