diff --git a/src/core/symbology/qgslinesymbollayer.cpp b/src/core/symbology/qgslinesymbollayer.cpp index 83c6cf2423f2..bea8b7d1418c 100644 --- a/src/core/symbology/qgslinesymbollayer.cpp +++ b/src/core/symbology/qgslinesymbollayer.cpp @@ -1620,7 +1620,6 @@ void QgsTemplatedLineSymbolLayerBase::renderPolylineVertex( const QPolygonF &poi QgsRenderContext &rc = context.renderContext(); - double origAngle = symbolAngle(); int i = -1, maxCount = 0; bool isRing = false; @@ -1675,7 +1674,7 @@ void QgsTemplatedLineSymbolLayerBase::renderPolylineVertex( const QPolygonF &poi if ( rotateSymbols() ) { double angle = context.renderContext().geometry()->vertexAngle( vId ); - setSymbolAngle( angle * 180 / M_PI ); + setSymbolLineAngle( angle * 180 / M_PI ); } renderSymbol( mapPoint, context.feature(), rc, -1, context.selected() ); } @@ -1723,8 +1722,6 @@ void QgsTemplatedLineSymbolLayerBase::renderPolylineVertex( const QPolygonF &poi double distance; distance = placement == QgsTemplatedLineSymbolLayerBase::FirstVertex ? offsetAlongLine : -offsetAlongLine; renderOffsetVertexAlongLine( points, i, distance, context ); - // restore original rotation - setSymbolAngle( origAngle ); return; } @@ -1753,7 +1750,7 @@ void QgsTemplatedLineSymbolLayerBase::renderPolylineVertex( const QPolygonF &poi { double angle = std::atan2( currentPoint.y() - prevPoint.y(), currentPoint.x() - prevPoint.x() ); - setSymbolAngle( origAngle + angle * 180 / M_PI ); + setSymbolLineAngle( angle * 180 / M_PI ); } prevPoint = currentPoint; } @@ -1764,15 +1761,12 @@ void QgsTemplatedLineSymbolLayerBase::renderPolylineVertex( const QPolygonF &poi if ( rotateSymbols() ) { double angle = markerAngle( points, isRing, i ); - setSymbolAngle( origAngle + angle * 180 / M_PI ); + setSymbolLineAngle( angle * 180 / M_PI ); } } renderSymbol( symbolPoint, context.feature(), rc, -1, context.selected() ); } - - // restore original rotation - setSymbolAngle( origAngle ); } double QgsTemplatedLineSymbolLayerBase::markerAngle( const QPolygonF &points, bool isRing, int vertex ) @@ -1856,7 +1850,6 @@ void QgsTemplatedLineSymbolLayerBase::renderOffsetVertexAlongLine( const QPolygo return; QgsRenderContext &rc = context.renderContext(); - double origAngle = symbolAngle(); if ( qgsDoubleNear( distance, 0.0 ) ) { // rotate marker (if desired) @@ -1866,7 +1859,7 @@ void QgsTemplatedLineSymbolLayerBase::renderOffsetVertexAlongLine( const QPolygo if ( points.first() == points.last() ) isRing = true; double angle = markerAngle( points, isRing, vertex ); - setSymbolAngle( origAngle + angle * 180 / M_PI ); + setSymbolLineAngle( angle * 180 / M_PI ); } renderSymbol( points[vertex], context.feature(), rc, -1, context.selected() ); return; @@ -1895,7 +1888,7 @@ void QgsTemplatedLineSymbolLayerBase::renderOffsetVertexAlongLine( const QPolygo // rotate marker (if desired) if ( rotateSymbols() ) { - setSymbolAngle( origAngle + ( l.angle() * 180 / M_PI ) ); + setSymbolLineAngle( l.angle() * 180 / M_PI ); } renderSymbol( markerPoint, context.feature(), rc, -1, context.selected() ); return;