surround method

void surround(
  1. Mobject mob, {
  2. int dimToMatch = 0,
  3. bool stretch = false,
  4. double? buffer,
})

Implementation

void surround(Mobject mob,
    {int dimToMatch = 0, bool stretch = false, double? buffer}) {
  buffer ??= MED_SMALL_BUFFER;

  replace(mob, dimToMatch: dimToMatch, stretch: stretch);
  var length = mob.lengthOverDim(dimToMatch);
  scaleUniformly((length + buffer) / length);
}