Kanvas
Renders the scene graph under root onto a transparent Compose canvas — every shape drawn in order with its own style, the scene uniformly fitted to the surface.
Layout: when no host modifier imposes a size, the canvas takes GroupNode.bounds as its intrinsic preferred size, one bounds unit per dp, falling back to 400 × 300 dp when the root carries no bounds. Host sizing in modifier (Modifier.fillMaxSize(), Modifier.size(...)) always wins.
Viewport: the draw pass runs at fitScale about the canvas center — the bounds uniformly fitted to the surface, aspect preserved, letterboxed on mismatch — and is clipped to the bounds rectangle, so nothing renders outside the scene and the letterbox bars stay inert; a shape wholly outside bounds simply doesn't render. Without bounds there is no clip and the surface is the world, one CGA unit per dp. An infinite Line draws as its chord through the bounds-derived worldBorder circle, so its visible span is a property of the scene, not of the surface showing it. Pointer input converts back through canvasToCga with the matching fitScale value.
Degenerate states that cannot be faithfully drawn — a FlatPoint, RoundPoint, or Line at infinity, a Line wholly outside the world border, an imaginary Circle or Dipole, an inside-out Circle or Polygon — are skipped with a console warning, never an error: the algebra keeps such values as first-class data; only the draw site declines them.
The canvas paints no background — letterboxed and unpainted regions show whatever is behind the composable; a scene supplies its own backdrop as content (a full-bleed rectangle Polygon first child). Every leaf draws with its ShapeNode.style exactly as given — styles arrive concrete from the scene graph, and no renderer-side fallback applies.
Parameters
The scene to draw; its GroupNode.bounds is the viewport.
The host's modifier chain; any size it imposes overrides the intrinsic size.