Viewport constructor

Viewport(
  1. Buffer parent,
  2. Rect bounds
)

Creates a viewport wrapping parent constrained to bounds.

Implementation

Viewport(this.parent, Rect bounds)
  : bounds = Rect(
      bounds.x,
      bounds.y,
      max(0, bounds.width),
      max(0, bounds.height),
    );