getPositionForPoint method

TextPosition getPositionForPoint (Offset globalPosition)

Returns the position in the text for the given global coordinate.

See also:

Implementation

TextPosition getPositionForPoint(Offset globalPosition) {
  _layoutText(constraints.maxWidth);
  globalPosition += -_paintOffset;
  return _textPainter.getPositionForOffset(globalToLocal(globalPosition));
}