closestAnchor

abstract fun closestAnchor(position: Float): T?

Find the closest anchor to the position.

Return

The closest anchor or null if the anchors are empty

Parameters

position

The position to start searching from


abstract fun closestAnchor(position: Float, searchUpwards: Boolean): T?

Find the closest anchor to the position, in the specified direction.

Return

The closest anchor or null if the anchors are empty

Parameters

position

The position to start searching from

searchUpwards

Whether to search upwards from the current position or downwards