diff options
author | Juan Linietsky <reduzio@gmail.com> | 2014-09-19 11:27:05 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2014-09-19 11:27:05 -0300 |
commit | f0f516442bcbfd410efb516055bc45b6411dd4da (patch) | |
tree | 6b44523bf8fd61e719a65c9d963f0553ddf936b2 | |
parent | 05d5253f8a13cd603f0ee3c647af26b46493ae0e (diff) | |
parent | 5cd174586afd51c1fc0091bc2235d0cfd7e14539 (diff) |
Merge pull request #705 from rollenrolm/vslider-fix
Fix for inverted VSlider
-rw-r--r-- | scene/gui/slider.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/scene/gui/slider.cpp b/scene/gui/slider.cpp index 68525cf464..39d0ccfd10 100644 --- a/scene/gui/slider.cpp +++ b/scene/gui/slider.cpp @@ -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 { |