Commit 53be3490 authored by philipoe's avatar philipoe

PrimaryFlightDisplay: Fixed a bug

parent d7725641
...@@ -1002,12 +1002,12 @@ void PrimaryFlightDisplay::drawAltimeter( ...@@ -1002,12 +1002,12 @@ void PrimaryFlightDisplay::drawAltimeter(
// Draw climb rate indicator as an arrow // Draw climb rate indicator as an arrow
float vvPixHeight = -climbRate/ALTIMETER_VVI_SPAN * effectiveHalfHeight; float vvPixHeight = -climbRate/ALTIMETER_VVI_SPAN * effectiveHalfHeight;
if (abs (vvPixHeight) < markerHalfHeight) if (vvPixHeight > -markerHalfHeight && vvPixHeight < 2 * markerHalfHeight + markerOffset)
return; // hidden behind marker. return; // hidden behind marker.
float vvSign = vvPixHeight>0 ? 1 : -1; // reverse y sign float vvSign = vvPixHeight>0 ? 1 : -1; // reverse y sign
QPointF vvArrowBegin(rightEdge - w*ALTIMETER_VVI_WIDTH / 2, (vvSign ? 2*markerHalfHeight+markerOffset : markerHalfHeight)); QPointF vvArrowBegin(rightEdge - w*ALTIMETER_VVI_WIDTH / 2, (vvSign>0 ? 2*markerHalfHeight+markerOffset : -markerHalfHeight));
QPointF vvArrowEnd(rightEdge - w*ALTIMETER_VVI_WIDTH/2, vvPixHeight); QPointF vvArrowEnd(rightEdge - w*ALTIMETER_VVI_WIDTH/2, vvPixHeight);
painter.drawLine(vvArrowBegin, vvArrowEnd); painter.drawLine(vvArrowBegin, vvArrowEnd);
......
Markdown is supported
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