fix gui1 sliders
this fixes issued with gui1 sliders beeing unable to handle negative min values.
This commit is contained in:
parent
8ee34c39b2
commit
f507418655
1 changed files with 4 additions and 1 deletions
|
@ -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()";
|
||||
|
@ -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_;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue