#829 Fixed strange category colors in odb intersections

This commit is contained in:
Jacob Støren 2016-09-09 09:58:28 +02:00
parent c360040213
commit ed93db724a

View File

@ -180,11 +180,13 @@ double CategoryMapper::domainValue(double normalizedValue) const
int CategoryMapper::categoryIndexForCategory(double domainValue) const int CategoryMapper::categoryIndexForCategory(double domainValue) const
{ {
int catIndex = -1; int catIndex = -1;
int intDomainValue = static_cast<int>(nearbyint(domainValue));
size_t i = 0; size_t i = 0;
while (i < m_categoryValues.size() && catIndex == -1) while (i < m_categoryValues.size() && catIndex == -1)
{ {
if (m_categoryValues[i] == domainValue) if (m_categoryValues[i] == intDomainValue)
{ {
catIndex = static_cast<int>(i); catIndex = static_cast<int>(i);
} }