BoundedPositionBehavior constructor

BoundedPositionBehavior({
  1. required Shape bounds,
  2. PositionProvider? target,
  3. double precision = 0.5,
  4. int? priority,
  5. ComponentKey? key,
})

Implementation

BoundedPositionBehavior({
  required Shape bounds,
  PositionProvider? target,
  double precision = 0.5,
  super.priority,
  super.key,
})  : assert(precision > 0, 'Precision must be positive: $precision'),
      _bounds = bounds,
      _target = target,
      _previousPosition = Vector2.zero(),
      _precision = precision;