pinetimestyle: Round the displayed temperature

Instead of truncating. This fixes the displayed temperature being 1
degree lower than expected when using GadgetBridge.
This commit is contained in:
FintasticMan 2024-01-02 02:11:28 +01:00
parent 3f51923c3b
commit 9b36afc787

View file

@ -548,7 +548,8 @@ void WatchFacePineTimeStyle::Refresh() {
if (settingsController.GetWeatherFormat() == Controllers::Settings::WeatherFormat::Imperial) { if (settingsController.GetWeatherFormat() == Controllers::Settings::WeatherFormat::Imperial) {
temp = Controllers::SimpleWeatherService::CelsiusToFahrenheit(temp); temp = Controllers::SimpleWeatherService::CelsiusToFahrenheit(temp);
} }
lv_label_set_text_fmt(temperature, "%d°", temp / 100); temp = temp / 100 + (temp % 100 >= 50 ? 1 : 0);
lv_label_set_text_fmt(temperature, "%d°", temp);
lv_label_set_text(weatherIcon, Symbols::GetSymbol(optCurrentWeather->iconId)); lv_label_set_text(weatherIcon, Symbols::GetSymbol(optCurrentWeather->iconId));
lv_obj_realign(temperature); lv_obj_realign(temperature);
lv_obj_realign(weatherIcon); lv_obj_realign(weatherIcon);