Merge pull request #705 from rollenrolm/vslider-fix

Fix for inverted VSlider
This commit is contained in:
Juan Linietsky 2014-09-19 11:27:05 -03:00
commit f0f516442b

View file

@ -49,7 +49,10 @@ void Slider::_input_event(InputEvent p_event) {
if (mb.pressed) {
grab.pos=orientation==VERTICAL?mb.y:mb.x;
double max = orientation==VERTICAL ? get_size().height : get_size().width ;
set_val( ( ( (double)grab.pos / max) * ( get_max() - get_min() ) ) + get_min() );
if (orientation==VERTICAL)
set_val( ( ( -(double)grab.pos / max) * ( get_max() - get_min() ) ) + get_max() );
else
set_val( ( ( (double)grab.pos / max) * ( get_max() - get_min() ) ) + get_min() );
grab.active=true;
grab.uvalue=get_unit_value();
} else {