fillArea method

void fillArea(
  1. Cell? cell,
  2. Rectangle area
)

Fills the buffer with cell within area.

Note: we step by cell width to avoid repeatedly overwriting wide-cell placeholders.

Upstream: third_party/ultraviolet/buffer.go (FillArea).

Implementation

void fillArea(Cell? cell, Rectangle area) {
  var cellWidth = 1;
  if (cell != null && cell.width > 1) cellWidth = cell.width;
  for (var y = area.minY; y < area.maxY; y++) {
    for (var x = area.minX; x < area.maxX; x += cellWidth) {
      setCell(x, y, cell);
    }
  }
}