-
Notifications
You must be signed in to change notification settings - Fork 563
Closed
Milestone
Description
I have the following Path: "...ZM...". NSScanner interprets this as a "ZM" command. The output is weird ;)
My workaround for SVGParser.swift at lines 1053:
repeat {
scanner.scanCharacters(from: set, into: &pathCommandName)
if pathCommandName?.length == 2 { // two commands without space, for example "ZM"
let command1 = pathCommandName!.substring(to: 1)
pathCommands.append(
PathCommand(
type: getCommandType(command1 as String),
expression: "",
absolute: isAbsolute(command1 as String)
)
)
pathCommandName = pathCommandName!.substring(from: 1) as NSString
}
scanner.scanUpToCharacters(from: set, into: &pathCommandValues)Maybe there is a nicer possibility? I don't really know NSScanner