setSize method

void setSize(
  1. int width,
  2. int height
)

Updates the viewport size.

Implementation

void setSize(int width, int height) {
  if (_model.width == width && _model.height == height) return;
  final widthChanged = _model.width != width;
  _model = _model.copyWith(
    width: width,
    height: height,
    viewport: _model.viewport.copyWith(width: width, height: height),
  );
  if (widthChanged) {
    // Re-render lines for new dimensions that affect diff composition.
    _model = _model.rerender();
  }
  _notifyListeners();
}