Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
path: root/src/ui
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2012-01-29 15:51:04 +0000
committerStijn Buys <ingar@osirion.org>2012-01-29 15:51:04 +0000
commit03064002bfbdbb10abe451d0f8dcfe7c6992e592 (patch)
tree2a7dda08253cc00e7a879bfd451ad13f390295f4 /src/ui
parent52bd0792d15e9a814cd38cf77b26784003b8569f (diff)
Clamp ui::Slider value while dragging.
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/slider.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ui/slider.cc b/src/ui/slider.cc
index c1b473c..9166656 100644
--- a/src/ui/slider.cc
+++ b/src/ui/slider.cc
@@ -164,7 +164,7 @@ void Slider::on_mousemove(const math::Vector2f &cursor)
math::clamp(x, 2.0f * height(), width() - 2.0f * height());
const float w = (width() - 4.0f * height());
const float s = w / (slider_maximum - slider_minimum);
- const float p = cursor.x() - 2.0f * height();
+ const float p = x - 2.0f * height();
const float newvalue = slider_minimum + round(p /s);
if (slider_value != newvalue) {
slider_value = newvalue;