From 1808ca3c51bf09b2c7bd6178ade5d0b2d42e5473 Mon Sep 17 00:00:00 2001 From: memeplex Date: Mon, 23 Jul 2018 10:42:42 -0300 Subject: [PATCH] fix(ramp): Evenly distribute states (#1340) Fixes #1328 --- src/drawtypes/ramp.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/drawtypes/ramp.cpp b/src/drawtypes/ramp.cpp index d533e651..b475da10 100644 --- a/src/drawtypes/ramp.cpp +++ b/src/drawtypes/ramp.cpp @@ -14,7 +14,7 @@ namespace drawtypes { } icon_t ramp::get_by_percentage(float percentage) { - size_t index = percentage * (m_icons.size() - 1) / 100.0f + 0.5f; + size_t index = percentage * m_icons.size() / 100.0f; return m_icons[math_util::cap(index, 0, m_icons.size() - 1)]; }