Commit 8aabdb09 authored by Maurice Kalinowski's avatar Maurice Kalinowski
Browse files

winrt: Fixup for 79697d9f


Task-number: QTBUG-56340
Change-Id: I9a3876d413d0d93d9ad74332677ff0244fb2e00a
Reviewed-by: default avatarOliver Wolff <oliver.wolff@qt.io>
parent b8b0a55e
Branches
Tags
No related merge requests found
Showing with 2 additions and 1 deletion
...@@ -491,8 +491,9 @@ HRESULT QGeoPositionInfoSourceWinRT::onPositionChanged(IGeolocator *locator, IPo ...@@ -491,8 +491,9 @@ HRESULT QGeoPositionInfoSourceWinRT::onPositionChanged(IGeolocator *locator, IPo
if (SUCCEEDED(hr) && heading) { if (SUCCEEDED(hr) && heading) {
double value; double value;
hr = heading->get_Value(&value); hr = heading->get_Value(&value);
double mod = 360; double mod = 0;
value = modf(value, &mod); value = modf(value, &mod);
value += static_cast<int>(mod) % 360;
if (value >=0 && value <= 359) // get_Value might return nan/-nan if (value >=0 && value <= 359) // get_Value might return nan/-nan
currentInfo.setAttribute(QGeoPositionInfo::Direction, value); currentInfo.setAttribute(QGeoPositionInfo::Direction, value);
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment