setCell method
Sets the cell at (x, y) and updates dirty tracking.
Implementation
void setCell(int x, int y, Cell? cell) {
if (y < 0 || y >= lines.length) return;
final current = cellAt(x, y);
final rawNext = cell ?? Cell.emptyCell();
final next = current == null
? _applyOpacity(rawNext)
: _compositeCell(current, _applyOpacity(rawNext));
if (_isOutsideScissor(x, y, next.width)) return;
if (current == null || current != next) {
final w = next.width > 0 ? next.width : 1;
touchLine(x, y, w);
}
lines[y].set(x, next);
}