Skip to content

Commit 4906d56

Browse files
committed
Fix #10819 (simple/marker line with offset on the wrong side of inner rings)
1 parent 43c4cd7 commit 4906d56

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

python/core/symbology-ng/qgslinesymbollayerv2.sip

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@ class QgsMarkerLineSymbolLayerV2 : QgsLineSymbolLayerV2
125125

126126
void renderPolyline( const QPolygonF& points, QgsSymbolV2RenderContext& context );
127127

128+
void renderPolygonOutline( const QPolygonF& points, QList<QPolygonF>* rings, QgsSymbolV2RenderContext& context );
129+
128130
QgsStringMap properties() const;
129131

130132
QgsSymbolLayerV2* clone() const;

src/core/symbology-ng/qgslinesymbollayerv2.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,8 +274,10 @@ void QgsSimpleLineSymbolLayerV2::renderPolygonOutline( const QPolygonF& points,
274274
renderPolyline( points, context );
275275
if ( rings )
276276
{
277+
mOffset = -mOffset; // invert the offset for rings!
277278
foreach ( const QPolygonF& ring, *rings )
278279
renderPolyline( ring, context );
280+
mOffset = -mOffset;
279281
}
280282

281283
if ( mDrawInsidePolygon )
@@ -848,6 +850,18 @@ void QgsMarkerLineSymbolLayerV2::renderPolyline( const QPolygonF& points, QgsSym
848850
}
849851
}
850852

853+
void QgsMarkerLineSymbolLayerV2::renderPolygonOutline( const QPolygonF& points, QList<QPolygonF>* rings, QgsSymbolV2RenderContext& context )
854+
{
855+
renderPolyline( points, context );
856+
if ( rings )
857+
{
858+
mOffset = -mOffset; // invert the offset for rings!
859+
foreach ( const QPolygonF& ring, *rings )
860+
renderPolyline( ring, context );
861+
mOffset = -mOffset;
862+
}
863+
}
864+
851865
void QgsMarkerLineSymbolLayerV2::renderPolylineInterval( const QPolygonF& points, QgsSymbolV2RenderContext& context )
852866
{
853867
if ( points.isEmpty() )

src/core/symbology-ng/qgslinesymbollayerv2.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,8 @@ class CORE_EXPORT QgsMarkerLineSymbolLayerV2 : public QgsLineSymbolLayerV2
176176

177177
void renderPolyline( const QPolygonF& points, QgsSymbolV2RenderContext& context );
178178

179+
void renderPolygonOutline( const QPolygonF& points, QList<QPolygonF>* rings, QgsSymbolV2RenderContext& context );
180+
179181
QgsStringMap properties() const;
180182

181183
QgsSymbolLayerV2* clone() const;

0 commit comments

Comments
 (0)