TextInclusionStrategy


The text inclusion strategy used by Paragraph.getRangeForRect, it specifies when a range of text is inside the given rect based on the geometric relation between the text range's bounding box and the given rect.

See also
getRangeForRect

Summary

Public companion properties

TextInclusionStrategy

The TextInclusionStrategy that includes the text range whose bounds has any overlap with the given rect.

Cmn
TextInclusionStrategy

The TextInclusionStrategy that includes the text range whose bounds is completely contained by the given rect.

Cmn
TextInclusionStrategy

The TextInclusionStrategy that includes the text range whose bounds' center is contained by the given rect.

Cmn

Public functions

Boolean
isIncluded(textBounds: Rect, rect: Rect)

Returns true if this TextInclusionStrategy considers the text range's textBounds to be inside the given rect.

Cmn

Public companion properties

AnyOverlap

val AnyOverlapTextInclusionStrategy

The TextInclusionStrategy that includes the text range whose bounds has any overlap with the given rect.

ContainsAll

val ContainsAllTextInclusionStrategy

The TextInclusionStrategy that includes the text range whose bounds is completely contained by the given rect.

ContainsCenter

val ContainsCenterTextInclusionStrategy

The TextInclusionStrategy that includes the text range whose bounds' center is contained by the given rect.

Public functions

isIncluded

fun isIncluded(textBounds: Rect, rect: Rect): Boolean

Returns true if this TextInclusionStrategy considers the text range's textBounds to be inside the given rect.

Parameters
textBounds: Rect

the bounding box of a range of the text.

rect: Rect

a rectangle area.