varLib.models: fix KeyError when no on-axis points while sorting masters
E.g. when trying to model/plot an unusual designspace like: fonttools varLib.plot 0,0 -1,-1 1,-1 -1,1 1,1
This commit is contained in:
parent
630a31e552
commit
38a8eb0e34
@ -239,7 +239,11 @@ class VariationModel(object):
|
||||
return -1 if v < 0 else +1 if v > 0 else 0
|
||||
def key(loc):
|
||||
rank = len(loc)
|
||||
onPointAxes = [axis for axis,value in loc.items() if value in axisPoints[axis]]
|
||||
onPointAxes = [
|
||||
axis for axis, value in loc.items()
|
||||
if axis in axisPoints
|
||||
and value in axisPoints[axis]
|
||||
]
|
||||
orderedAxes = [axis for axis in axisOrder if axis in loc]
|
||||
orderedAxes.extend([axis for axis in sorted(loc.keys()) if axis not in axisOrder])
|
||||
return (
|
||||
|
Loading…
x
Reference in New Issue
Block a user