aboutsummaryrefslogtreecommitdiffstats
path: root/src/displayapp
diff options
context:
space:
mode:
authorFintasticMan <finlay.neon.kid@gmail.com>2024-01-02 02:11:28 +0100
committerFintasticMan <finlay.neon.kid@gmail.com>2024-01-03 21:01:53 +0100
commit9b36afc7878e05e7d37ba48b77f7bc95c44c6ee6 (patch)
tree1f111abfb252f1bb82012c8c3fb545a438adff8a /src/displayapp
parent3f51923c3b2ae1f726b28654becda22977abc3ec (diff)
pinetimestyle: Round the displayed temperature
Instead of truncating. This fixes the displayed temperature being 1 degree lower than expected when using GadgetBridge.
Diffstat (limited to 'src/displayapp')
-rw-r--r--src/displayapp/screens/WatchFacePineTimeStyle.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/displayapp/screens/WatchFacePineTimeStyle.cpp b/src/displayapp/screens/WatchFacePineTimeStyle.cpp
index 4b4da052..296323d3 100644
--- a/src/displayapp/screens/WatchFacePineTimeStyle.cpp
+++ b/src/displayapp/screens/WatchFacePineTimeStyle.cpp
@@ -548,7 +548,8 @@ void WatchFacePineTimeStyle::Refresh() {
if (settingsController.GetWeatherFormat() == Controllers::Settings::WeatherFormat::Imperial) {
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_obj_realign(temperature);
lv_obj_realign(weatherIcon);