summaryrefslogtreecommitdiff
path: root/scene/gui/slider.cpp
diff options
context:
space:
mode:
authorsantiagopf <punto@Ariels-Mac-mini.local>2015-12-14 10:58:26 -0300
committersantiagopf <punto@Ariels-Mac-mini.local>2015-12-14 10:58:26 -0300
commita9795d582665598decd4e73e1d879c83ce28a44b (patch)
tree777a3da33fed3d6906704680e01bd87f97eba113 /scene/gui/slider.cpp
parentc8077de71475c174aa14fd045a2cddfc28de2468 (diff)
parentbfaa179e7088d9d6f4cf289e1915eec12c6b3b2a (diff)
Merge branch 'master' of https://github.com/godotengine/godot
Diffstat (limited to 'scene/gui/slider.cpp')
-rw-r--r--scene/gui/slider.cpp4
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 {