fillArea function

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

Fills area of screen with cell.

Implementation

void fillArea(Screen screen, Cell? cell, Rectangle area) {
  if (screen is FillAreaScreen) {
    screen.fillArea(cell, area);
    return;
  }

  for (var y = area.minY; y < area.maxY; y++) {
    for (var x = area.minX; x < area.maxX; x++) {
      screen.setCell(x, y, cell);
    }
  }
}