Skip to content

Commit

Permalink
Fixed bug is setting Depth Units in realsense_viewer
Browse files Browse the repository at this point in the history
Tracked on: DSO-9736
  • Loading branch information
belkinirena authored Jun 25, 2018
1 parent 719b0b9 commit 882aeee
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions common/model-views.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -560,19 +560,14 @@ namespace rs2
}
else
{
auto step = fmod(range.step, 1);
int pow_val = 10;
while ((step *= 10.f) < 0.f)
{
pow_val *= 10;
}

if (ImGui::SliderFloat(id.c_str(), &value,
range.min, range.max, "%.4f"))
{
auto loffset = fmod(value, range.step);
auto roffset = range.step - loffset;
value = (loffset < roffset) ? value - loffset : value + roffset;
value = (value < range.min) ? range.min : value;
value = (value > range.max) ? range.max : value;
value = (int)(value * pow_val) / (float)(pow_val);
model.add_log(to_string() << "Setting " << opt << " to " << value);
endpoint->set_option(opt, value);
*invalidate_flag = true;
Expand Down

0 comments on commit 882aeee

Please sign in to comment.