Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[pal] Use QgsGeometry::makeValid instead of buffer(0) to repair geome…
…tries

Possibly refs #14752

(cherry-picked from e05a5a9)
  • Loading branch information
nyalldawson committed Mar 6, 2018
1 parent fc7b99e commit 2345733
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/core/qgspallabeling.cpp
Expand Up @@ -2931,12 +2931,12 @@ QgsGeometry QgsPalLabeling::prepareGeometry( const QgsGeometry &geometry, QgsRen
// fix invalid polygons
if ( geom.type() == QgsWkbTypes::PolygonGeometry && !geom.isGeosValid() )
{
QgsGeometry bufferGeom = geom.buffer( 0, 0 );
if ( bufferGeom.isNull() )
QgsGeometry validGeom = geom.makeValid();
if ( validGeom.isNull() )
{
return QgsGeometry();
}
geom = bufferGeom;
geom = validGeom;
}

if ( !clipGeometry.isNull() &&
Expand Down

0 comments on commit 2345733

Please sign in to comment.