From 5b03af6b732c42aa310aeb47dc87d8edcb5f55e5 Mon Sep 17 00:00:00 2001 From: eska Date: Thu, 10 Dec 2015 23:48:03 +0100 Subject: [PATCH] Fix exponential sliders --- scene/gui/slider.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scene/gui/slider.cpp b/scene/gui/slider.cpp index b6292c544b3..78b5dabeb42 100644 --- a/scene/gui/slider.cpp +++ b/scene/gui/slider.cpp @@ -50,9 +50,9 @@ void Slider::_input_event(InputEvent p_event) { grab.pos=orientation==VERTICAL?mb.y:mb.x; double max = orientation==VERTICAL ? get_size().height : get_size().width ; if (orientation==VERTICAL) - set_val( ( ( -(double)grab.pos / max) * ( get_max() - get_min() ) ) + get_max() ); + set_unit_value( 1 - ((double)grab.pos / max) ); else - set_val( ( ( (double)grab.pos / max) * ( get_max() - get_min() ) ) + get_min() ); + set_unit_value((double)grab.pos / max); grab.active=true; grab.uvalue=get_unit_value(); } else {