Commit 83134634 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt4 - SoundSlider setToolTip only in the correct range.

parent eb4e90d1
......@@ -203,10 +203,10 @@ void SoundSlider::mouseMoveEvent( QMouseEvent *event )
}
else
{
setToolTip( QString("%1 \%" )
.arg( (int)( event->x() - paddingL ) * maximum() / WLENGTH ) );
int i = ( event->x() - paddingL ) * maximum() / WLENGTH;
i = __MIN( __MAX( 0, i ), maximum() );
setToolTip( QString("%1 \%" ).arg( i ) );
}
}
void SoundSlider::changeValue( int x )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment