VectorImage

data class VectorImage(val viewportWidth: Float, val viewportHeight: Float, val intrinsicWidth: Float, val intrinsicHeight: Float, val paths: List<VectorPath>)

Resolved vector graphic ready for layout and drawing.

Produced by parse (or one of its convenience overloads), which accepts either Android <vector> XML or standard <svg> XML and returns an instance of this class. The renderer scales paths from the (viewportWidth × viewportHeight) viewport into whatever destination rectangle the user requested through the vector(...) DSL.

Two coordinate systems are involved:

  • Viewport (viewportWidth × viewportHeight) — the path data is authored in this space. Most icons use 24×24 because that's the Android Material Design canvas size.

  • Intrinsic size (width × height) — the size the source XML suggests for the icon. The DSL falls back to this when neither width nor height is supplied at the call site.

Constructors

Link copied to clipboard
constructor(viewportWidth: Float, viewportHeight: Float, intrinsicWidth: Float, intrinsicHeight: Float, paths: List<VectorPath>)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard