Source set: Common
@Deprecated(
"The TextField flavors that use VisualTransformation are deprecated. Please" +
" refer to OutputTransformation."
)
/** Provides bidirectional offset mapping between original and transformed text. */
public interface OffsetMapping
Functions
originalToTransformed
Source set: Common
public fun originalToTransformed(offset: Int): Int
Convert offset in original text into the offset in transformed text.
This function must be a monotonically non-decreasing function. In other words, if a cursor advances in the original text, the cursor in the transformed text must advance or stay there.
Parameters
| offset | offset in original text. |
Return
offset in transformed text
transformedToOriginal
Source set: Common
public fun transformedToOriginal(offset: Int): Int
Convert offset in transformed text into the offset in original text.
This function must be a monotonically non-decreasing function. In other words, if a cursor advances in the transformed text, the cursor in the original text must advance or stay there.
Parameters
| offset | offset in transformed text |
Return
offset in original text
Members
Companion
Source set: Common
public companion object
Properties
Identity
Source set: Common
@Deprecated(
"The TextField flavors that use VisualTransformation are deprecated. Please" +
" refer to OutputTransformation."
)
/** The offset map used for identity mapping. */
public val Identity: OffsetMapping =
object : OffsetMapping {
public override fun originalToTransformed(offset: Int): Int = offset
public override fun transformedToOriginal(offset: Int): Int = offset
}