models: convert delta array to float if overflows signed short integers
We should check other places where such overflows may occur and do the same. Or do maybe it in GlyphCoordinates class.
This commit is contained in:
parent
6b6c34ab1a
commit
0055f9414c
@ -299,7 +299,12 @@ class VariationModel(object):
|
||||
for i,weights in enumerate(self.deltaWeights):
|
||||
delta = masterValues[mapping[i]]
|
||||
for j,weight in weights.items():
|
||||
delta -= out[j] * weight
|
||||
try:
|
||||
delta -= out[j] * weight
|
||||
except OverflowError:
|
||||
# if it doesn't fit signed shorts, retry with doubles
|
||||
delta._ensureFloat()
|
||||
delta -= out[j] * weight
|
||||
out.append(delta)
|
||||
return out
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user