Skip to content

Commit

Permalink
add Direction of Crosshairs in Oculars.
Browse files Browse the repository at this point in the history
  • Loading branch information
ultrapre committed Jan 13, 2025
1 parent 4133590 commit 584f64f
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions plugins/Oculars/src/Oculars.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2080,6 +2080,25 @@ void Oculars::paintCrosshairs()
a = ch_transform.map(QPoint(-hw, 0));
b = ch_transform.map(QPoint(hw, 0));
painter.drawLine2d(a.x(), a.y(), b.x(), b.y());

if (getFlagAlignCrosshair())
{
bool flipH = core->getFlipHorz();
bool flipV = core->getFlipVert();
painter.setColor(1.0, 1.0, 1.0);

QPoint sDirection = ch_transform.map(QPoint(0, hw + 20));
painter.drawText(sDirection.x(), sDirection.y(), "N");

QPoint nDirection = ch_transform.map(QPoint(0, -hw - 20));
painter.drawText(nDirection.x(), nDirection.y(), "S");

QPoint wDirection = ch_transform.map(QPoint(-hw - 20, 0));
painter.drawText(wDirection.x(), wDirection.y(), flipH == flipV ? "E" : "W");

QPoint eDirection = ch_transform.map(QPoint(hw + 20, 0));
painter.drawText(eDirection.x(), eDirection.y(), flipH == flipV ? "W" : "E");
}
}

void Oculars::paintTelrad()
Expand Down

0 comments on commit 584f64f

Please sign in to comment.