]> git.sesse.net Git - vlc/commitdiff
skins2: fix RadialSlider (overflow)
authorErwan Tulou <erwan10@videolan.org>
Thu, 1 Jul 2010 13:45:42 +0000 (15:45 +0200)
committerErwan Tulou <erwan10@videolan.org>
Thu, 1 Jul 2010 13:50:17 +0000 (15:50 +0200)
position varies between 0 and (n-1) when n images are available.
This fixes the widget disappearing when slider was at 100%.

modules/gui/skins2/controls/ctrl_radialslider.cpp

index 43f9eb80fed015958527317f4946b0cc36549fb6..a1bbec3c00e02dc8d6632327e31c4b064548c718 100644 (file)
@@ -100,7 +100,7 @@ void CtrlRadialSlider::draw( OSGraphics &rImage, int xDest, int yDest )
 void CtrlRadialSlider::onUpdate( Subject<VarPercent> &rVariable,
                                  void *arg  )
 {
-    m_position = (int)( m_rVariable.get() * m_numImg );
+    m_position = (int)( m_rVariable.get() * ( m_numImg - 1 ) );
     notifyLayout( m_width, m_height );
 }