reassemble method

  1. @override
void reassemble()
override

Re-resolves sprite through Sprite.reload, so an image replaced in the cache reaches the screen without rebuilding this node.

Implementation

@override
void reassemble() {
  _sprite = _sprite.reload();

  // Clamp the playhead if the replacement is smaller. A row that went away
  // takes its frame with it.
  if (_row >= _sprite.rows) {
    _row = 0;
    _frame = 0;
  } else if (_frame >= _sprite.frames(_row)) {
    _frame = 0;
  }

  _source = null;
  _destination = null;
}