summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2014-09-19 11:27:05 -0300
committerJuan Linietsky <reduzio@gmail.com>2014-09-19 11:27:05 -0300
commitf0f516442bcbfd410efb516055bc45b6411dd4da (patch)
tree6b44523bf8fd61e719a65c9d963f0553ddf936b2
parent05d5253f8a13cd603f0ee3c647af26b46493ae0e (diff)
parent5cd174586afd51c1fc0091bc2235d0cfd7e14539 (diff)
Merge pull request #705 from rollenrolm/vslider-fix
Fix for inverted VSlider
-rw-r--r--scene/gui/slider.cpp5
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 {