diff options
| author | Victor Kareh <vkareh@redhat.com> | 2024-12-06 11:07:51 -0500 |
|---|---|---|
| committer | FintasticMan <finlay.neon.kid@gmail.com> | 2024-12-10 00:02:17 +0100 |
| commit | d69cfcfb136e45486437ad773d362da7870042e3 (patch) | |
| tree | 093c49787ecd9a8ff9cc5d8f60637656af24f351 /src/displayapp/screens/Weather.cpp | |
| parent | b8c51abe691a2d0f6770f4bfef3574541f49d744 (diff) | |
weather: Fix inverted imperial forecast temperatures
When converting to imperial units, the min and max temperatures were
incorrectly inverted, causing confusion in the display.
Fixes https://github.com/InfiniTimeOrg/InfiniTime/issues/2183
Diffstat (limited to 'src/displayapp/screens/Weather.cpp')
| -rw-r--r-- | src/displayapp/screens/Weather.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/displayapp/screens/Weather.cpp b/src/displayapp/screens/Weather.cpp index d3ee78ef..25464c70 100644 --- a/src/displayapp/screens/Weather.cpp +++ b/src/displayapp/screens/Weather.cpp @@ -154,11 +154,11 @@ void Weather::Refresh() { std::tm localTime = *std::localtime(reinterpret_cast<const time_t*>(&optCurrentForecast->timestamp)); for (int i = 0; i < optCurrentForecast->nbDays; i++) { - int16_t minTemp = optCurrentForecast->days[i]->minTemperature.Celsius(); int16_t maxTemp = optCurrentForecast->days[i]->maxTemperature.Celsius(); + int16_t minTemp = optCurrentForecast->days[i]->minTemperature.Celsius(); if (settingsController.GetWeatherFormat() == Controllers::Settings::WeatherFormat::Imperial) { - minTemp = optCurrentForecast->days[i]->maxTemperature.Fahrenheit(); - maxTemp = optCurrentForecast->days[i]->minTemperature.Fahrenheit(); + maxTemp = optCurrentForecast->days[i]->maxTemperature.Fahrenheit(); + minTemp = optCurrentForecast->days[i]->minTemperature.Fahrenheit(); } lv_table_set_cell_type(forecast, 2, i, TemperatureStyle(optCurrentForecast->days[i]->maxTemperature)); lv_table_set_cell_type(forecast, 3, i, TemperatureStyle(optCurrentForecast->days[i]->minTemperature)); |
