particle/ramp: value is *also* offsetted by the minimum value

This commit is contained in:
Daniel Eklöf 2019-01-19 20:17:26 +01:00
parent cffb007009
commit bfa9ce9970

View file

@ -107,7 +107,7 @@ instantiate(const struct particle *particle, const struct tag_set *tags)
size_t idx = 0; size_t idx = 0;
if (max - min > 0) if (max - min > 0)
idx = p->count * value / (max - min); idx = p->count * (value - min) / (max - min);
if (idx == p->count) if (idx == p->count)
idx--; idx--;