Skip to content

Commit

Permalink
fix gui1 sliders
Browse files Browse the repository at this point in the history
this fixes issued with gui1 sliders beeing unable to handle negative min
values.
  • Loading branch information
gfgtdf committed Feb 18, 2016
1 parent 8ee34c3 commit f507418
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/widgets/slider.cpp
Expand Up @@ -25,6 +25,9 @@
#include "video.hpp"


#include <boost/math/special_functions/sign.hpp>


namespace {
const std::string slider_image = ".png";
const std::string disabled_image = ".png~GS()";
Expand Down Expand Up @@ -89,7 +92,7 @@ void slider::set_value(int value)
value = min_;

if (increment_ > 1) {
int hi = increment_ / 2;
int hi = boost::math::sign(value) * increment_ / 2;
value = ((value + hi) / increment_) * increment_;
}

Expand Down

0 comments on commit f507418

Please sign in to comment.