Skip to content

Commit 2345733

Browse files
committed
[pal] Use QgsGeometry::makeValid instead of buffer(0) to repair geometries
Possibly refs #14752 (cherry-picked from e05a5a9)
1 parent fc7b99e commit 2345733

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/core/qgspallabeling.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2931,12 +2931,12 @@ QgsGeometry QgsPalLabeling::prepareGeometry( const QgsGeometry &geometry, QgsRen
29312931
// fix invalid polygons
29322932
if ( geom.type() == QgsWkbTypes::PolygonGeometry && !geom.isGeosValid() )
29332933
{
2934-
QgsGeometry bufferGeom = geom.buffer( 0, 0 );
2935-
if ( bufferGeom.isNull() )
2934+
QgsGeometry validGeom = geom.makeValid();
2935+
if ( validGeom.isNull() )
29362936
{
29372937
return QgsGeometry();
29382938
}
2939-
geom = bufferGeom;
2939+
geom = validGeom;
29402940
}
29412941

29422942
if ( !clipGeometry.isNull() &&

0 commit comments

Comments
 (0)