Skip to content

Commit

Permalink
Update float values parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
egorikftp committed Sep 6, 2024
1 parent ce823d6 commit 0cf5bdd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
8 changes: 4 additions & 4 deletions components/parser/ktfile/src/test/resources/EmptyPaths.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ val ValkyrieIcons.EmptyPaths: ImageVector
}
_EmptyPaths = ImageVector.Builder(
name = "EmptyPaths",
defaultWidth = 24.dp,
defaultHeight = 24.dp,
viewportWidth = 18f,
viewportHeight = 18f,
defaultWidth = 24.0.dp,
defaultHeight = 24.0.dp,
viewportWidth = 18.0f,
viewportHeight = 18.0f
).apply {
path { }
path { }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,9 @@ internal object RegularImageVectorPsiParser {
if (value == null) return 0f

return value
.replace("dp", "")
.replace("f", "")
.removeSuffix(".dp")
.removeSuffix("f")
.removeSuffix("F")
.toFloatOrNull() ?: 0f
}

Expand Down

0 comments on commit 0cf5bdd

Please sign in to comment.