drawCanvasShapes function

void drawCanvasShapes(
  1. Screen screen,
  2. Rectangle area,
  3. Iterable<CanvasShape> shapes, {
  4. CanvasRange xBounds = const CanvasRange(0, 100),
  5. CanvasRange yBounds = const CanvasRange(0, 100),
  6. UvStyle fallbackStyle = const UvStyle(),
})

Draws shapes into screen using a braille sub-cell canvas.

Implementation

void drawCanvasShapes(
  Screen screen,
  Rectangle area,
  Iterable<CanvasShape> shapes, {
  CanvasRange xBounds = const CanvasRange(0, 100),
  CanvasRange yBounds = const CanvasRange(0, 100),
  UvStyle fallbackStyle = const UvStyle(),
}) {
  if (area.isEmpty) return;
  final canvas = BrailleCanvas(area.width, area.height);
  final painter = CanvasPainter(canvas, xBounds: xBounds, yBounds: yBounds);
  for (final shape in shapes) {
    painter.draw(shape);
  }
  canvas.renderTo(screen, area, fallbackStyle: fallbackStyle);
}