From 78d9223704c0169a77b1ccad53d3c6dadba50f67 Mon Sep 17 00:00:00 2001 From: didier Date: Wed, 20 Jun 2018 11:53:19 +0200 Subject: [PATCH 1/2] adjust displayed current arrows with viewpoint rotation --- src/RouteMapOverlay.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/RouteMapOverlay.cpp b/src/RouteMapOverlay.cpp index d4156727..da6f4d1c 100644 --- a/src/RouteMapOverlay.cpp +++ b/src/RouteMapOverlay.cpp @@ -1139,7 +1139,8 @@ void RouteMapOverlay::RenderCurrent(wrDC &dc, PlugIn_ViewPort &vp) #endif double VW = d*VW1 + (1-d)*VW2; - g_LineBufferOverlay.pushSingleArrow(current_cache, x, y, VW, deg2rad(W+180), lat < 0 ); + g_LineBufferOverlay.pushSingleArrow(current_cache, x, y, VW, + deg2rad(W+180) + nvp.rotation, lat < 0 ); } skip:; From 25da38718c68204130adbf176599cc287234095f Mon Sep 17 00:00:00 2001 From: didier Date: Wed, 12 Sep 2018 13:24:48 +0200 Subject: [PATCH 2/2] LineBufferOverlay: Result is not floating-point dec/2 is an integer and calling round() doesn't make sense, dec/2.0 is a double From coverity 'integer_division: Dividing integer expressions dec and 2, and then converting the integer quotient to type double. Any remainder, or fractional part of the quotient, is ignored.' --- src/LineBufferOverlay.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/LineBufferOverlay.cpp b/src/LineBufferOverlay.cpp index 69cc2f7d..b6b9d7e8 100644 --- a/src/LineBufferOverlay.cpp +++ b/src/LineBufferOverlay.cpp @@ -153,9 +153,9 @@ void LineBufferOverlay::setLineBuffer() arrow.pushLine( 0, dec, 0, dec - windArrowSize ); // hampe // Right arrow - arrow.pushLine(0, dec - ceil(m_lineWidth / 2 * sqrt(2)), round(dec/4 + (m_lineWidth / 2 * sqrt(2))), round(dec/2)); + arrow.pushLine(0, dec - ceil(m_lineWidth / 2 * sqrt(2)), round(dec/4 + (m_lineWidth / 2 * sqrt(2))), round(dec/2.)); // Left arrow - arrow.pushLine(0, dec - ceil(m_lineWidth / 2 * sqrt(2)), round(-dec/4 - (m_lineWidth / 2 * sqrt(2))), round(dec/2)); + arrow.pushLine(0, dec - ceil(m_lineWidth / 2 * sqrt(2)), round(-dec/4 - (m_lineWidth / 2 * sqrt(2))), round(dec/2.)); } float alpha = 0.38;