mirror of
https://github.com/exyte/Macaw.git
synced 2024-09-21 09:59:10 +03:00
Merge pull request #232 from amarunko/bug/path-parsing
Fix for values parsing (dot separated)
This commit is contained in:
commit
724c28c36a
@ -1097,7 +1097,7 @@ open class SVGParser {
|
||||
let commandParams = command.expression.components(separatedBy: characterSet)
|
||||
var separatedValues = [String]()
|
||||
commandParams.forEach { param in
|
||||
separatedValues.append(contentsOf: separateNegativeValuesIfNeeded(param))
|
||||
separatedValues.append(contentsOf: separateValuesIfNeeded(param))
|
||||
}
|
||||
|
||||
switch command.type {
|
||||
@ -1186,7 +1186,7 @@ open class SVGParser {
|
||||
}
|
||||
}
|
||||
|
||||
fileprivate func separateNegativeValuesIfNeeded(_ expression: String) -> [String] {
|
||||
fileprivate func separateValuesIfNeeded(_ expression: String) -> [String] {
|
||||
var values = [String]()
|
||||
var value = String()
|
||||
var e = false
|
||||
@ -1202,6 +1202,15 @@ open class SVGParser {
|
||||
}
|
||||
e = false
|
||||
}
|
||||
|
||||
if scalar == "."
|
||||
&& !e
|
||||
&& value.contains(".") {
|
||||
|
||||
values.append(value)
|
||||
value = String()
|
||||
e = false
|
||||
}
|
||||
|
||||
value.append("\(scalar)")
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user