diff options
author | Stijn Buys <ingar@osirion.org> | 2012-01-29 15:51:04 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2012-01-29 15:51:04 +0000 |
commit | 03064002bfbdbb10abe451d0f8dcfe7c6992e592 (patch) | |
tree | 2a7dda08253cc00e7a879bfd451ad13f390295f4 /src/ui | |
parent | 52bd0792d15e9a814cd38cf77b26784003b8569f (diff) |
Clamp ui::Slider value while dragging.
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/slider.cc | 2 |
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; |