Fixed drawing weather icon when alt coordinates isn't present
parent
1957abecbc
commit
bb8388e95c
|
@ -15,10 +15,10 @@ namespace WatchFace.Parser.Models.Elements
|
||||||
|
|
||||||
public void Draw(Graphics drawer, Bitmap[] resources, WatchState state)
|
public void Draw(Graphics drawer, Bitmap[] resources, WatchState state)
|
||||||
{
|
{
|
||||||
if (state.CurrentTemperature != null)
|
var useAltCoordinates = CurrentAlt != null && state.CurrentTemperature == null;
|
||||||
drawer.DrawImage(LoadWeatherImage(state.CurrentWeather), Current.X, Current.Y);
|
var iconCoordinates = useAltCoordinates ? CurrentAlt : Current;
|
||||||
else
|
|
||||||
drawer.DrawImage(LoadWeatherImage(state.CurrentWeather), CurrentAlt.X, CurrentAlt.Y);
|
drawer.DrawImage(LoadWeatherImage(state.CurrentWeather), iconCoordinates.X, iconCoordinates.Y);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Bitmap LoadWeatherImage(WeatherCondition weather)
|
private static Bitmap LoadWeatherImage(WeatherCondition weather)
|
||||||
|
|
Loading…
Reference in New Issue