Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Close Path not recognized if there is no space #216

Closed
JoachimM7 opened this issue Nov 1, 2017 · 2 comments
Closed

Close Path not recognized if there is no space #216

JoachimM7 opened this issue Nov 1, 2017 · 2 comments
Assignees
Milestone

Comments

@JoachimM7
Copy link
Contributor

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

@ystrot ystrot self-assigned this Nov 2, 2017
@ystrot ystrot added this to the 0.9.1 milestone Nov 2, 2017
@ystrot ystrot modified the milestones: 0.9.1, 0.9.2 Nov 28, 2017
@ystrot
Copy link
Member

ystrot commented Dec 13, 2017

This one is fixed in the master version. Please let us know if it doesn't work for you.

@ystrot
Copy link
Member

ystrot commented Jun 28, 2018

Fix available in the release version, so closing this ticket.

@ystrot ystrot closed this as completed Jun 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants