Composition

class Composition(val root: CompositionNode, var bounds: CompositionDimensions = defaultCompositionDimensions)

A vector composition.

Parameters

root

the root node of the composition

bounds

the dimensions of the composition

Constructors

Link copied to clipboard
fun Composition(root: CompositionNode, bounds: Rectangle)
Link copied to clipboard
fun Composition(root: CompositionNode, bounds: CompositionDimensions = defaultCompositionDimensions)

Functions

Link copied to clipboard
fun calculateViewportTransform(): Matrix44

Calculates effective viewport transformation using viewBox and preserveAspectRatio. As per the SVG 2.0 spec.

Link copied to clipboard
fun clear(): Unit?
Link copied to clipboard
fun findGroup(id: String): GroupNode?
Link copied to clipboard
fun findGroups(): List<GroupNode>
Link copied to clipboard
fun findImage(id: String): ImageNode?
Link copied to clipboard
fun findImages(): List<ImageNode>
Link copied to clipboard
fun findShape(id: String): ShapeNode?
Link copied to clipboard
fun findShapes(): List<ShapeNode>

Properties

Link copied to clipboard
var bounds: CompositionDimensions
Link copied to clipboard
var documentStyle: DocumentStyle

The style attributes affecting the whole document, such as the viewBox area and aspect ratio.

Link copied to clipboard
val namespaces: MutableMap<String, String>

SVG/XML namespaces

Link copied to clipboard
val root: CompositionNode
Link copied to clipboard
var style: Style

Extensions

Link copied to clipboard
fun Composition.draw(drawFunction: CompositionDrawer.() -> Unit)

Draw into an existing Composition.

Sources

Link copied to clipboard