truncateTo method

void truncateTo(
  1. int length
)

Clamps the reveal when the source shrank to a prefix of itself.

The surviving prefix keeps its stamps, so text that merely restyled — a construct claiming characters the tail had already shown — carries on its entrance instead of starting over.

Implementation

void truncateTo(int length) {
  if (_revealed > length) {
    _revealed = length.toDouble();
  }
  if (_settledBelow > length) {
    _settledBelow = length;
  }
}