[varLib] Clamp values in normalizeLocation()
This commit is contained in:
parent
06b1840866
commit
9ed319d0ad
@ -12,9 +12,9 @@ def normalizeLocation(location, axes):
|
|||||||
if v == default:
|
if v == default:
|
||||||
v = 0
|
v = 0
|
||||||
elif v < default:
|
elif v < default:
|
||||||
v = (v - default) / (default - lower)
|
v = (max(v, lower) - default) / (default - lower)
|
||||||
else:
|
else:
|
||||||
v = (v - default) / (upper - default)
|
v = (min(v, upper) - default) / (upper - default)
|
||||||
out[tag] = v
|
out[tag] = v
|
||||||
return out
|
return out
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user