paintLine method

void paintLine(
  1. Canvas canvas,
  2. Offset offset,
  3. BufferLine line
)

Paints line to canvas at offset. The x offset of offset is usually 0, and the y offset is the top of the line.

Implementation

void paintLine(
  Canvas canvas,
  Offset offset,
  BufferLine line,
) {
  final cellData = CellData.empty();
  final cellWidth = _cellSize.width;

  for (var i = 0; i < line.length; i++) {
    line.getCellData(i, cellData);

    final charWidth = cellData.content >> CellContent.widthShift;
    final cellOffset = offset.translate(i * cellWidth, 0);

    paintCell(canvas, cellOffset, cellData);

    if (charWidth == 2) {
      i++;
    }
  }
}