draw method

void draw(
  1. void render(
    1. Buffer
    ),
  2. [Rect? bounds]
)

Calls the given render function with a buffer for drawing.

If bounds is not provided it defaults to the entire frame.

Implementation

void draw(void Function(Buffer) render, [Rect? bounds]) {
  var buffer = _buffer;
  if (bounds != null) {
    buffer = buffer.subGrid(bounds);
  }
  render(buffer);
}