diff options
author | eska <eska@eska.me> | 2015-12-10 23:48:03 +0100 |
---|---|---|
committer | eska <eska@eska.me> | 2015-12-10 23:48:03 +0100 |
commit | 5b03af6b732c42aa310aeb47dc87d8edcb5f55e5 (patch) | |
tree | 292ac3700c0e0a9417152b06863d1795dc92c6fd /scene | |
parent | 3b68f0d051ac33a95e78025622c5f93219591da9 (diff) |
Fix exponential sliders
Diffstat (limited to 'scene')
-rw-r--r-- | scene/gui/slider.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/scene/gui/slider.cpp b/scene/gui/slider.cpp index b6292c544b..78b5dabeb4 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 { |