1
1
mirror of https://github.com/exyte/Macaw.git synced 2024-09-21 09:59:10 +03:00

SVGParser: exponential format fix

This commit is contained in:
Viktor Sukochev 2018-03-12 23:50:17 +07:00
parent 19af79615c
commit 214cbaf084

View File

@ -1198,6 +1198,7 @@ private class PathDataReader {
private let input: String
private var current: UnicodeScalar?
private var previous: UnicodeScalar?
private var iterator: String.UnicodeScalarView.Iterator
init(input: String) {
@ -1265,7 +1266,7 @@ private class PathDataReader {
fileprivate func readDigit(_ hasDot: inout Bool) -> UnicodeScalar? {
if let ch = readNext() {
if (ch >= "0" && ch <= "9") {
if ((ch >= "0" && ch <= "9") || ch == "e" || (previous == "e" && ch == "-") ) {
return ch
} else if (ch == "." && !hasDot) {
hasDot = true
@ -1290,6 +1291,7 @@ private class PathDataReader {
}
private func readNext() -> UnicodeScalar? {
previous = current
current = iterator.next()
return current
}