Fixed drawing weather icon when alt coordinates isn't present

fonts_experiment 1.0.2.5
Valeriy Mironov 2017-12-25 13:04:29 +02:00
parent 1957abecbc
commit bb8388e95c
1 changed files with 4 additions and 4 deletions

View File

@ -15,10 +15,10 @@ namespace WatchFace.Parser.Models.Elements
public void Draw(Graphics drawer, Bitmap[] resources, WatchState state)
{
if (state.CurrentTemperature != null)
drawer.DrawImage(LoadWeatherImage(state.CurrentWeather), Current.X, Current.Y);
else
drawer.DrawImage(LoadWeatherImage(state.CurrentWeather), CurrentAlt.X, CurrentAlt.Y);
var useAltCoordinates = CurrentAlt != null && state.CurrentTemperature == null;
var iconCoordinates = useAltCoordinates ? CurrentAlt : Current;
drawer.DrawImage(LoadWeatherImage(state.CurrentWeather), iconCoordinates.X, iconCoordinates.Y);
}
private static Bitmap LoadWeatherImage(WeatherCondition weather)