diff --git a/src/EdgeTemplate.qml b/src/EdgeTemplate.qml index c4a36fcb..de0525bc 100644 --- a/src/EdgeTemplate.qml +++ b/src/EdgeTemplate.qml @@ -131,12 +131,12 @@ Item { strokeWidth: 2 startX: 0; startY: 0 PathArc { - relativeX: edgeItem.dstA2.x; relativeY: edgeItem.dstA2.y - radiusX: edgeItem.dstA1.x; radiusY: edgeItem.dstA1.y; + relativeX: edgeItem.srcA2.x; relativeY: edgeItem.srcA2.y + radiusX: edgeItem.srcA1.x; radiusY: edgeItem.srcA1.y; } PathArc { - relativeX: -edgeItem.dstA2.x; relativeY: edgeItem.dstA2.y - radiusX: edgeItem.dstA1.x; radiusY: edgeItem.dstA1.y; + relativeX: -edgeItem.srcA2.x; relativeY: edgeItem.srcA2.y + radiusX: edgeItem.srcA1.x; radiusY: edgeItem.srcA1.y; } } } diff --git a/src/qanEdgeItem.cpp b/src/qanEdgeItem.cpp index 745d0b34..e24580f4 100644 --- a/src/qanEdgeItem.cpp +++ b/src/qanEdgeItem.cpp @@ -490,7 +490,7 @@ void EdgeItem::generateArrowGeometry(GeometryCache& cache) const noexcept generateArrowAngle(cache.p2, cache.p1, cache.srcAngle, cache.c2, cache.c1, cache.lineType, - getDstShape(), + getSrcShape(), arrowLength); // Update destination arrow cache points @@ -517,7 +517,6 @@ void EdgeItem::generateArrowGeometry(GeometryCache& cache) const noexcept cache.lineType, getDstShape(), arrowLength); - } void EdgeItem::generateArrowAngle(QPointF& p1, QPointF& p2, qreal& angle, @@ -532,7 +531,7 @@ void EdgeItem::generateArrowAngle(QPointF& p1, QPointF& p2, qreal& angle, if ( lineType == qan::EdgeStyle::LineType::Straight ) { if ( line.length() > MinLength && // Protect line.length() DIV0 arrowShape != ArrowShape::None) // Do not correct edge extremity by arrowLength if there is not arrow - p2 = line.pointAt( 1.0 - (arrowLength/line.length()) ); + p2 = line.pointAt( 1.0 - (arrowLength / line.length()) ); angle = lineAngle(line); } else if ( lineType == qan::EdgeStyle::LineType::Curved ) { // Generate arrow orientation: @@ -554,7 +553,7 @@ void EdgeItem::generateArrowAngle(QPointF& p1, QPointF& p2, qreal& angle, QVector2D dstVector{ QPointF{c2.x() - p2.x(), c2.y() - p2.y()} }; dstVector.normalize(); dstVector *= static_cast(arrowLength); - p2 = p2 + dstVector.toPointF(); + p2 = QPointF{p2} + dstVector.toPointF(); } } }