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

DesignSpaceProcessor.splitAnisotropic() returns dicts instead of Locations #29

Closed
josh-hadley opened this issue Mar 23, 2020 · 0 comments · Fixed by #30
Closed

DesignSpaceProcessor.splitAnisotropic() returns dicts instead of Locations #29

josh-hadley opened this issue Mar 23, 2020 · 0 comments · Fixed by #30

Comments

@josh-hadley
Copy link
Collaborator

This:

locHorizontal, locVertical = self.splitAnisotropic(loc)
passes a Location object to splitAnisotropic() and attempts to use the returned results as if they were Location objects, as in:
kerningObject = kerningMutator.makeInstance(locHorizontal, bend=bend)

But splitAnisotropic returns two dicts:

def splitAnisotropic(self, location):
x = {}
y = {}
for dim, val in location.items():
if type(val)==tuple:
x[dim] = val[0]
y[dim] = val[1]
else:
x[dim] = y[dim] = val
return x, y

When MutatorMath is in use, this causes a failure because MutatorMath is expecting a Location object, not a dict:
https://github.com/LettError/MutatorMath/blob/94b392ac20648947a37f7166d98bc6988424bfad/Lib/mutatorMath/objects/mutator.py#L226

A test case in the AFDKO test suite exposes this issue.

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

Successfully merging a pull request may close this issue.

1 participant