fillRect function
Fills a rectangular region on screen with style as the background.
Implementation
void fillRect(
Screen screen,
Rectangle area,
int x,
int y,
int w,
int h,
UvStyle style,
) {
final bg = style.bg ?? style.fg;
if (bg == null) return;
final fill = UvStyle(fg: bg, bg: bg);
final startX = math.max(x, area.minX);
final startY = math.max(y, area.minY);
final maxX = math.min(x + w, area.maxX);
final maxY = math.min(y + h, area.maxY);
for (var py = startY; py < maxY; py++) {
for (var px = startX; px < maxX; px++) {
putCell(screen, px, py, ' ', fill);
}
}
}