diff --git a/libs/opmapcontrol/src/mapwidget/uavitem.cpp b/libs/opmapcontrol/src/mapwidget/uavitem.cpp index f854c9c989f8832654030ee9f0743f1acc187234..28011cbd88e6ad8e7657a5b7c0f3a38b4fd041a8 100644 --- a/libs/opmapcontrol/src/mapwidget/uavitem.cpp +++ b/libs/opmapcontrol/src/mapwidget/uavitem.cpp @@ -58,7 +58,10 @@ namespace mapcontrol Q_UNUSED(option); Q_UNUSED(widget); // painter->rotate(-90); + QPainter::RenderHints oldhints = painter->renderHints(); + painter->setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform); painter->drawPixmap(-pic.width()/2,-pic.height()/2,pic); + painter->setRenderHints(oldhints); // painter->drawRect(QRectF(-pic.width()/2,-pic.height()/2,pic.width()-1,pic.height()-1)); } QRectF UAVItem::boundingRect()const diff --git a/src/ui/HSIDisplay.cc b/src/ui/HSIDisplay.cc index 7129f26e32f49440cb11d0ca19b422c54ce94155..736b5f27956992208974ab87ee35c994c4388536 100644 --- a/src/ui/HSIDisplay.cc +++ b/src/ui/HSIDisplay.cc @@ -1310,9 +1310,13 @@ void HSIDisplay::drawSafetyArea(const QPointF &topLeft, const QPointF &bottomRig void HSIDisplay::drawGPS(QPainter &painter) { float xCenter = xCenterPos; - float yCenter = xCenterPos; - // Max satellite circle radius + float yCenter = yCenterPos; + const float yawDeg = ((yaw/M_PI)*180.0f); + int yawRotate = static_cast(yawDeg) % 360; + // XXX check rotation direction + + // Max satellite circle radius const float margin = 0.15f; // 20% margin of total width on each side float radius = (vwidth - vwidth * 2.0f * margin) / 2.0f; quint64 currTime = MG::TIME::getGroundTimeNowUsecs(); @@ -1353,8 +1357,8 @@ void HSIDisplay::drawGPS(QPainter &painter) painter.setPen(color); painter.setBrush(brush); - float xPos = xCenter + (sin(((sat->azimuth/255.0f)*360.0f)/180.0f * M_PI) * cos(sat->elevation/180.0f * M_PI)) * radius; - float yPos = yCenter - (cos(((sat->azimuth/255.0f)*360.0f)/180.0f * M_PI) * cos(sat->elevation/180.0f * M_PI)) * radius; + float xPos = xCenter + (sin(((sat->azimuth/255.0f)*360.0f-yawRotate)/180.0f * M_PI) * cos(sat->elevation/180.0f * M_PI)) * radius; + float yPos = yCenter - (cos(((sat->azimuth/255.0f)*360.0f-yawRotate)/180.0f * M_PI) * cos(sat->elevation/180.0f * M_PI)) * radius; // Draw circle for satellite, filled for used satellites drawCircle(xPos, yPos, vwidth*0.02f, 1.0f, color, &painter);