From 584f64fdbe1be44aa73474daa0c8275617e31959 Mon Sep 17 00:00:00 2001 From: ultrapre Date: Mon, 13 Jan 2025 23:34:02 +0800 Subject: [PATCH] add Direction of Crosshairs in Oculars. --- plugins/Oculars/src/Oculars.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/plugins/Oculars/src/Oculars.cpp b/plugins/Oculars/src/Oculars.cpp index eb69fc3f1689d..9bdabf03f9b17 100644 --- a/plugins/Oculars/src/Oculars.cpp +++ b/plugins/Oculars/src/Oculars.cpp @@ -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()