coverMorphWeights method

  1. @override
void coverMorphWeights(
  1. Float32List weights
)
inherited

Grows localBounds to cover a node drawing with weights. Called before culling; the default does nothing.

Implementation

@override
void coverMorphWeights(Float32List weights) {
  final count = weights.length < _morphData.targetCount
      ? weights.length
      : _morphData.targetCount;
  var grew = false;
  for (var t = 0; t < count; t++) {
    final w = weights[t];
    if (w < _coveredLow[t]) {
      _coveredLow[t] = w;
      grew = true;
    } else if (w > _coveredHigh[t]) {
      _coveredHigh[t] = w;
      grew = true;
    }
  }
  // Bounds replaced since the last expansion need expanding too.
  if (grew || localBoundsVersion != _expandedBoundsVersion) {
    _updateMorphBounds();
  }
}