[pal] Use QgsGeometry::makeValid instead of buffer(0) to repair geometries

Possibly refs #14752
This commit is contained in:
Nyall Dawson 2018-02-27 13:58:22 +10:00
parent 70242a3ac4
commit e05a5a9302

View File

@ -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() &&