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

Translate doesn't work for relative paths made with .rel #10

Closed
bojidar-bg opened this issue Oct 14, 2015 · 3 comments
Closed

Translate doesn't work for relative paths made with .rel #10

bojidar-bg opened this issue Oct 14, 2015 · 3 comments

Comments

@bojidar-bg
Copy link

If one attempts to translate a path and calls .rel nothing will happen.

testPath = "m 70, 70 l 20, 20 l -20, 0 l 0, -20"
svgpath(testPath).translate(100, 100).toString()
// "M170 170l20 20-20 0 0-20" - as expected
svgpath(testPath).translate(100, 100).rel().toString()
// "m70 70l20 20-20 0 0-20" - now.. that one is not translated
svgpath( svgpath(testPath).rel().toString() ).translate(100,100).toString()
// "M170 170l20 20-20 0 0-20" - as expected
@puzrin
Copy link
Member

puzrin commented Oct 14, 2015

// "m70 70l20 20-20 0 0-20" - now.. that one is not translated

It shifted starting point of relative path ([170, 170] -> [70, 70]), and returned relative path. What's the problem with it? Why you decided this result is not correct?

@puzrin
Copy link
Member

puzrin commented Oct 14, 2015

Ah, did not understood your example! Got it.

@puzrin puzrin closed this as completed in 0d4a88e Oct 27, 2015
@puzrin
Copy link
Member

puzrin commented Oct 27, 2015

Should be fixed now. Problem was, that first m in path should be always processed as absolute. I also changed .rel() to not lower case first 'M'.

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