From 2176664c394f7c6b69a60c8d0b741d62303c10dc Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 9 Apr 2017 10:34:10 +0200 Subject: [PATCH] couple svg.kt style changes --- .../kotlin/com/simplemobiletools/draw/Svg.kt | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/draw/Svg.kt b/app/src/main/kotlin/com/simplemobiletools/draw/Svg.kt index fd37494..1216b94 100644 --- a/app/src/main/kotlin/com/simplemobiletools/draw/Svg.kt +++ b/app/src/main/kotlin/com/simplemobiletools/draw/Svg.kt @@ -44,8 +44,8 @@ object Svg { private fun writePath(writer: Writer, path: MyPath, options: PaintOptions) { writer.apply { write(" - val width = Integer.parseInt(attributes.getValue("width")) - val height = Integer.parseInt(attributes.getValue("height")) + val width = attributes.getValue("width").toInt() + val height = attributes.getValue("height").toInt() svg.setSize(width, height) } rectElement.setStartElementListener { attributes -> - val width = Integer.parseInt(attributes.getValue("width")) - val height = Integer.parseInt(attributes.getValue("height")) + val width = attributes.getValue("width").toInt() + val height = attributes.getValue("height").toInt() val color = Color.parseColor(attributes.getValue("fill")) if (svg.background != null) throw UnsupportedOperationException("Unsupported SVG, should only have one .") @@ -103,7 +103,7 @@ object Svg { pathElement.setStartElementListener { attributes -> val d = attributes.getValue("d") val color = Color.parseColor(attributes.getValue("stroke")) - val width = java.lang.Float.parseFloat(attributes.getValue("stroke-width")) + val width = attributes.getValue("stroke-width").toFloat() svg.paths.add(SPath(d, color, width)) }