Package-level declarations

The composable and the conversion boundary. Kanvas draws the scene; cgaToCanvas / canvasToCga convert between CGA model space (centered, Y-up) and canvas px (top-left-origin, Y-down) — the module's single coordinate boundary; fitScale is the one draw-scale formula the draw pass and pointer-input conversion share; and worldBorder derives the circle infinite lines are clipped against.

Functions

Link copied to clipboard
fun canvasToCga(position: Offset, size: Size, scale: Float = 1.0f): FlatPoint

Returns the model-space FlatPoint under the canvas position — the pointer-input inverse of cgaToCanvas.

Link copied to clipboard
fun cgaToCanvas(cgaX: Double, cgaY: Double, size: Size, scale: Float = 1.0f): Offset

Returns the canvas position of the model-space point (cgaX, cgaY).

Link copied to clipboard
fun fitScale(size: Size, bounds: SceneBounds?, density: Float): Float

Returns the draw scale — physical px per CGA unit — fitting a scene with bounds onto a surface of size: the one value the draw pass and pointer-input conversion must share.

Link copied to clipboard
@Composable
fun Kanvas(root: GroupNode, modifier: Modifier = Modifier)

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.

Link copied to clipboard
fun worldBorder(size: Size, bounds: SceneBounds?, scale: Float): Circle

Returns the world-border circle infinite shapes are clipped against, for a surface of size showing a scene with bounds at the draw scale.