Skip to content

Commit

Permalink
InfoBoxes/Contenet/Weather: Update wind arrow according to heading va…
Browse files Browse the repository at this point in the history
…riations

Fixes XCSoar#914
  • Loading branch information
styblope committed May 31, 2022
1 parent e96790f commit 06c3c50
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/InfoBoxes/Content/Weather.cpp
Expand Up @@ -188,12 +188,16 @@ void
InfoBoxContentWindArrow::Update(InfoBoxData &data) noexcept
{
const DerivedInfo &info = CommonInterface::Calculated();
const NMEAInfo &basic = CommonInterface::Basic();
if (!info.wind_available || info.wind.IsZero()) {
data.SetInvalid();
return;
}

data.SetCustom(info.wind_available.ToInteger());
// Enables OnCustomPaint
data.SetCustom(info.wind_available.ToInteger() +
basic.attitude.heading_available.ToInteger() +
basic.track_available.ToInteger());

TCHAR speed_buffer[16];
FormatUserWindSpeed(info.wind.norm, speed_buffer, true, false);
Expand Down

0 comments on commit 06c3c50

Please sign in to comment.