drawCanvasShapes function
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(),
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);
}