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

[feaLib.variableScalar] fix value_at_location() method #3491

Merged
merged 1 commit into from May 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion Lib/fontTools/feaLib/variableScalar.py
Expand Up @@ -75,10 +75,11 @@
return self.values[key]

def value_at_location(self, location, model_cache=None, avar=None):
loc = location
loc = Location(location)

Check warning on line 78 in Lib/fontTools/feaLib/variableScalar.py

View check run for this annotation

Codecov / codecov/patch

Lib/fontTools/feaLib/variableScalar.py#L78

Added line #L78 was not covered by tests
if loc in self.values.keys():
return self.values[loc]
values = list(self.values.values())
loc = dict(self._normalized_location(loc))

Check warning on line 82 in Lib/fontTools/feaLib/variableScalar.py

View check run for this annotation

Codecov / codecov/patch

Lib/fontTools/feaLib/variableScalar.py#L82

Added line #L82 was not covered by tests
return self.model(model_cache, avar).interpolateFromMasters(loc, values)

def model(self, model_cache=None, avar=None):
Expand Down