Update extensions/GUI/CCControlExtension/CCControlSlider.cpp

This commit is contained in:
ThePickleMan 2012-09-03 09:46:55 -05:00
parent da819e1109
commit a4d2d317b5
1 changed files with 1 additions and 1 deletions

View File

@ -236,7 +236,7 @@ void CCControlSlider::sliderEnded(CCPoint location)
float CCControlSlider::valueForLocation(CCPoint location) float CCControlSlider::valueForLocation(CCPoint location)
{ {
float percent = (location.x-SLIDER_MARGIN_H)/ m_backgroundSprite->getContentSize().width; float percent = (location.x-SLIDER_MARGIN_H)/ m_backgroundSprite->getContentSize().width;
return max(min(m_minimumValue + percent * (m_maximumValue - m_minimumValue), m_maximumAllowedValue), m_minimumAllowedValue); return MAX(MIN(m_minimumValue + percent * (m_maximumValue - m_minimumValue), m_maximumAllowedValue), m_minimumAllowedValue);
} }
NS_CC_EXT_END NS_CC_EXT_END