From 268318e02c825f3e7e45de9c66da7d736cdfacd9 Mon Sep 17 00:00:00 2001 From: f4exb Date: Sun, 4 Jul 2021 11:25:53 +0200 Subject: [PATCH] AIS feature: use course if heading is not available for ship image orientation in Map feature --- plugins/feature/ais/aisgui.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/plugins/feature/ais/aisgui.cpp b/plugins/feature/ais/aisgui.cpp index 33498620f..7201b6b6e 100644 --- a/plugins/feature/ais/aisgui.cpp +++ b/plugins/feature/ais/aisgui.cpp @@ -538,8 +538,11 @@ void AISGUI::updateVessels(AISMessage *ais) if (!destination.isEmpty()) { text.append(QString("Destination: %1").arg(destination)); } - if (!courseV.isNull()) { - text.append(QString("Course: %1%2").arg(courseV.toFloat()).arg(QChar(0xb0))); + if (!courseV.isNull()) + { + float course = courseV.toFloat(); + text.append(QString("Course: %1%2").arg(course).arg(QChar(0xb0))); + swgMapItem->setImageRotation(course); } if (!speedV.isNull()) { text.append(QString("Speed: %1 knts").arg(speedV.toFloat())); @@ -548,7 +551,7 @@ void AISGUI::updateVessels(AISMessage *ais) { float heading = headingV.toFloat(); text.append(QString("Heading: %1%2").arg(heading).arg(QChar(0xb0))); - swgMapItem->setImageRotation(heading); + swgMapItem->setImageRotation(heading); // heading takes precedence over course } if (!shipType.isEmpty()) { text.append(QString("Ship type: %1").arg(shipType));