transformStack method

void transformStack(
  1. List<Delta> stack,
  2. Delta delta
)

Implementation

void transformStack(List<Delta> stack, Delta delta) {
  for (var i = stack.length - 1; i >= 0; i -= 1) {
    final oldDelta = stack[i];
    stack[i] = delta.transform(oldDelta, true);
    delta = oldDelta.transform(delta, false);
    if (stack[i].length == 0) {
      stack.removeAt(i);
    }
  }
}