Fix cases of assigning get_float_pref() to a float variable
It's called "get_float_pref" because it returns a floating-point. However, that floating-point is in double precision.
This commit is contained in:
@@ -1233,7 +1233,7 @@ void pick_preferences() {
|
||||
}
|
||||
|
||||
cLedGroup& uiScale = dynamic_cast<cLedGroup&>(prefsDlog["scaleui"]);
|
||||
float ui_scale = get_float_pref("UIScale", 1.0);
|
||||
double ui_scale = get_float_pref("UIScale", 1.0);
|
||||
if (ui_scale>0.95 && ui_scale<1.05) uiScale.setSelected("1");
|
||||
else if (ui_scale>1.45 && ui_scale<1.55) uiScale.setSelected("1_5");
|
||||
else if (ui_scale>1.95 && ui_scale<2.05) uiScale.setSelected("2");
|
||||
@@ -1242,7 +1242,7 @@ void pick_preferences() {
|
||||
else uiScale.setSelected("other");
|
||||
|
||||
cLedGroup& uiMapScale = dynamic_cast<cLedGroup&>(prefsDlog["scalemap"]);
|
||||
float ui_map_scale = get_float_pref("UIScaleMap", 1.0);
|
||||
double ui_map_scale = get_float_pref("UIScaleMap", 1.0);
|
||||
if (ui_map_scale>0.95 && ui_map_scale<1.05) uiMapScale.setSelected("1");
|
||||
else if (ui_map_scale>1.45 && ui_map_scale<1.55) uiMapScale.setSelected("1_5");
|
||||
else if (ui_map_scale>1.95 && ui_map_scale<2.05) uiMapScale.setSelected("2");
|
||||
|
@@ -137,7 +137,7 @@ void adjust_window_mode() {
|
||||
winSettings.stencilBits = 1;
|
||||
sf::VideoMode desktop = sf::VideoMode::getDesktopMode();
|
||||
hideMenuBar();
|
||||
float ui_scale = get_float_pref("UIScale", 1.0);
|
||||
double ui_scale = get_float_pref("UIScale", 1.0);
|
||||
if(ui_scale < 0.1) ui_scale = 1.0;
|
||||
float width = 605 * ui_scale, height = 430 * ui_scale;
|
||||
|
||||
|
@@ -673,7 +673,7 @@ short get_num_of_items(short max_num) {
|
||||
}
|
||||
|
||||
void init_mini_map() {
|
||||
float ui_scale = get_float_pref("UIScaleMap", 1.0);
|
||||
double ui_scale = get_float_pref("UIScaleMap", 1.0);
|
||||
if (ui_scale < 0.1) ui_scale = 1.0;
|
||||
if (mini_map.isOpen()) mini_map.close();
|
||||
mini_map.create(sf::VideoMode(ui_scale*296,ui_scale*277), "Map", sf::Style::Titlebar | sf::Style::Close);
|
||||
|
Reference in New Issue
Block a user