Skip to content

Commit

Permalink
round instead of floor to fitting value in slider::set_value
Browse files Browse the repository at this point in the history
  • Loading branch information
gfgtdf committed Nov 16, 2017
1 parent 8c1f07f commit 1c44296
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/gui/widgets/slider.cpp
Expand Up @@ -86,7 +86,7 @@ void slider::set_value(int value)
return;
}

set_slider_position((value - minimum_value_) / step_size_);
set_slider_position(rounded_division(value - minimum_value_, step_size_));

if(std::abs(get_value() - value) > (step_size_ / 2)) {
ERR_GUI_G << "slider::set_value error:"
Expand All @@ -95,7 +95,7 @@ void slider::set_value(int value)
<< " desired_value=" << value
<< " minimum_value=" << minimum_value_
<< " maximum_value=" << get_maximum_value()
<< " step_size=" << step_size_ "\n";
<< " step_size=" << step_size_ << "\n";
assert(false);
}
assert();
Expand Down

0 comments on commit 1c44296

Please sign in to comment.