fillRect method

void fillRect(
  1. int char,
  2. int top,
  3. int left,
  4. int bottom,
  5. int right,
)

Implementation

void fillRect(int char, int top, int left, int bottom, int right) {
  final rect = _normalizeRect(top, left, bottom, right);
  if (rect == null) return;
  if (unicodeV11.wcwidth(char) != 1) return;

  for (var row = rect.top; row <= rect.bottom; row++) {
    final line = lines[row + scrollBack];
    line.eraseRange(rect.left, rect.right + 1, terminal.cursor);
    for (var col = rect.left; col <= rect.right; col++) {
      line.setCell(col, char, 1, terminal.cursor);
    }
  }
}