From bfa9ce997097711f4d91f6a3d43fdd30028128e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Sat, 19 Jan 2019 20:17:26 +0100 Subject: [PATCH] particle/ramp: value is *also* offsetted by the minimum value --- particles/ramp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/particles/ramp.c b/particles/ramp.c index 987ff64..868d854 100644 --- a/particles/ramp.c +++ b/particles/ramp.c @@ -107,7 +107,7 @@ instantiate(const struct particle *particle, const struct tag_set *tags) size_t idx = 0; if (max - min > 0) - idx = p->count * value / (max - min); + idx = p->count * (value - min) / (max - min); if (idx == p->count) idx--;