Skip to content

Commit

Permalink
tpreferences: fixed accelerated speed slider
Browse files Browse the repository at this point in the history
Apparently, to_string has inconsistent behavior when operating on
floating point types, so revert to using lexical_cast.
  • Loading branch information
Vultraz committed Apr 1, 2016
1 parent 4645d65 commit f497d4c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/gui/dialogs/preferences_dialog.cpp
Expand Up @@ -448,7 +448,7 @@ void tpreferences::initialize_members(twindow& window)
find_widget<tslider>(&window, "turbo_slider", false);

const int selected_speed = std::find(
(accl_speeds_.begin()), accl_speeds_.end(), std::to_string(turbo_speed()))
(accl_speeds_.begin()), accl_speeds_.end(), lexical_cast<std::string>(turbo_speed()))
- (accl_speeds_.begin());

accl_slider.set_value_labels(accl_speeds_);
Expand Down

0 comments on commit f497d4c

Please sign in to comment.