find<S> method

  1. @override
S find <S>(Offset regionOffset)
override

Returns the value of S that corresponds to the point described by regionOffset.

Returns null if no matching region is found.

The main way for a value to be assigned here is by pushing an AnnotatedRegionLayer into the layer tree.

See also:

Implementation

@override
S find<S>(Offset regionOffset) {
  if (_inverseDirty) {
    _invertedTransform = Matrix4.tryInvert(transform);
    _inverseDirty = false;
  }
  if (_invertedTransform == null)
    return null;
  final Vector4 vector = Vector4(regionOffset.dx, regionOffset.dy, 0.0, 1.0);
  final Vector4 result = _invertedTransform.transform(vector);
  return super.find<S>(Offset(result[0], result[1]));
}