INNER CODE UNIT · Kotlin
constructor
JetBrains/kotlinconf-app · app/shared/src/nonAndroidMain/kotlin/Svg.nonAndroid.kt:10
actual class Svg actual constructor(svgString: String) {
private val svg = SVGDOM(Data.makeFromBytes(svgString.toByteArray()))
actual val width: Float get() = svg.root?.width?.value ?: 0f
actual val height: Float get() = svg.root?.height?.value ?: 0f
actual fun renderTo(scope: DrawScope) {
scope.drawIntoCanvas { canvas ->
svg.render(canvas.nativeCanvas)
}
}
}