hitTest method

TextEntity? hitTest(
  1. Offset sourcePoint
)

The topmost entity whose rotated + scaled layout bounds contain sourcePoint.

Implementation

TextEntity? hitTest(Offset sourcePoint) {
  for (final entity in entities.reversed) {
    if (_bounds(entity).contains(_toEntityLocal(entity, sourcePoint))) {
      return entity;
    }
  }
  return null;
}