Skip to content

Commit

Permalink
Fix labeling using perimeter with repeating label distance set
Browse files Browse the repository at this point in the history
If the visible part of a polygon is clipped and becomes a multipolygon, only
one label is plotted on the wrong side of the polygon.

Settings:
Placement: Using Perimeter
Allowed positions: Below line / Line orientation dependent position checked
Repeat: 100 mm

Fix #15341

(cherry-picked from c0b1684)
  • Loading branch information
nyalldawson committed Jul 29, 2016
1 parent 5ebe9d1 commit bfa7714
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/core/qgspallabeling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2517,7 +2517,8 @@ void QgsPalLayerSettings::registerFeature( QgsFeature& f, QgsRenderContext &cont
}

GEOSGeometry* geos_geom_clone;
if ( GEOSGeomTypeId_r( QgsGeometry::getGEOSHandler(), geos_geom ) == GEOS_POLYGON && repeatDistance > 0 && placement == Line )
GEOSGeomTypes geomType = (GEOSGeomTypes) GEOSGeomTypeId_r( QgsGeometry::getGEOSHandler(), geos_geom );
if ( (geomType == GEOS_POLYGON || geomType == GEOS_MULTIPOLYGON) && repeatDistance > 0 && placement == Line )
{
geos_geom_clone = GEOSBoundary_r( QgsGeometry::getGEOSHandler(), geos_geom );
}
Expand Down

0 comments on commit bfa7714

Please sign in to comment.