forked from external/yambar
particle/ramp: value is *also* offsetted by the minimum value
This commit is contained in:
parent
cffb007009
commit
bfa9ce9970
1 changed files with 1 additions and 1 deletions
|
@ -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--;
|
||||||
|
|
Loading…
Add table
Reference in a new issue