getBeginningPositionNearX method
Returns the earliest position within this component's
DocumentNode that appears at or near the given x
position.
This is useful, for example, when moving selection into the beginning of some text while maintaining the existing horizontal position of the selection.
Implementation
@override
TextNodePosition getBeginningPositionNearX(double x) {
return TextNodePosition.fromTextPosition(
textLayout.getPositionInFirstLineAtX(x),
);
}