1/****************************************************************************
3 * (c) 2009-2024 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
5 * QGroundControl is licensed according to the terms in the file
6 * COPYING.md in the root of the source code directory.
8 ****************************************************************************/
14import QGroundControl.Controls
15import QGroundControl.GeoMap
17/// Google Maps-style teardrop marker anchored at its tip. Shows an inner dot
18/// by default, or a short label when one is set.
22 property color color: qgcPal.mapIndicator
23 property alias label: labelText.text
25 readonly property real _headRadius: width / 2
27 // Tangent points where straight tail lines touch the head circle, so the
28 // arc flows into the tail without a corner. Clamped: height <= 2 * head
29 // radius has no tangent solution and would produce NaN geometry.
30 readonly property real _tangentAngle: Math.acos(Math.min(1, _headRadius / (height - _headRadius)))
31 readonly property real _tangentDX: _headRadius * Math.sin(_tangentAngle)
32 readonly property real _tangentY: _headRadius + _headRadius * Math.cos(_tangentAngle)
34 width: ScreenTools.defaultFontPixelHeight * 1.25
36 anchorPoint: Qt.point(width / 2, height)
38 QGCPalette { id: qgcPal; colorGroupEnabled: root.enabled }
42 preferredRendererType: Shape.CurveRenderer
48 startX: root.width / 2
52 x: root.width / 2 - root._tangentDX
56 x: root.width / 2 + root._tangentDX
58 radiusX: root._headRadius
59 radiusY: root._headRadius
61 direction: PathArc.Clockwise
71 anchors.horizontalCenter: parent.horizontalCenter
72 y: root._headRadius - height / 2
73 width: root._headRadius * 0.8
76 color: Qt.darker(root.color, 1.5)
77 visible: labelText.text === ""
83 anchors.horizontalCenter: parent.horizontalCenter
84 y: root._headRadius - height / 2