parent
934e277ccd
commit
1808ca3c51
1 changed files with 1 additions and 1 deletions
|
@ -14,7 +14,7 @@ namespace drawtypes {
|
||||||
}
|
}
|
||||||
|
|
||||||
icon_t ramp::get_by_percentage(float percentage) {
|
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<size_t>(index, 0, m_icons.size() - 1)];
|
return m_icons[math_util::cap<size_t>(index, 0, m_icons.size() - 1)];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue