diff options
Diffstat (limited to 'scene')
-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 { |