Skip to content

Commit

Permalink
[feaLib.variableScalar] fix value_at_location() method
Browse files Browse the repository at this point in the history
  • Loading branch information
justvanrossum committed Apr 28, 2024
1 parent 6db3cee commit 44ed452
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Lib/fontTools/feaLib/variableScalar.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,11 @@ def default(self):
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

0 comments on commit 44ed452

Please sign in to comment.