diff --git a/src/core/qgssggeometry.cpp b/src/core/qgssggeometry.cpp index 3fec7e8ac8..19f1097c3f 100644 --- a/src/core/qgssggeometry.cpp +++ b/src/core/qgssggeometry.cpp @@ -164,7 +164,7 @@ QSGGeometry *QgsSGGeometry::qgsPolygonToQSGGeometry( const QgsPolygon *polygon, Q_ASSERT( polygon ); QgsGeometry geom( polygon->clone() ); - geom = geom.buffer( 0.0000001, 5 ); + geom = geom.buffer( 0.0000001, 1, Qgis::EndCapStyle::Flat, Qgis::JoinStyle::Miter, 5 ); QgsPolygon *bufferedPolygon = qgsgeometry_cast( geom.constGet() ); QgsTessellator t( visibleExtent.xMinimum(), visibleExtent.yMaximum(), false, false, false, true ); if ( bufferedPolygon ) diff --git a/src/core/sgrubberband.cpp b/src/core/sgrubberband.cpp index 64e30ab2d5..d1b23b54a5 100644 --- a/src/core/sgrubberband.cpp +++ b/src/core/sgrubberband.cpp @@ -109,7 +109,9 @@ QSGGeometryNode *SGRubberband::createLineGeometry( const QVector &poin QSGGeometryNode *SGRubberband::createPolygonGeometry( const QVector &points ) { QgsGeometry geom( new QgsPolygon( new QgsLineString( points ) ) ); - geom = geom.buffer( 0.0000001, 5 ); + geom = geom.buffer( 0.0000001, 1, Qgis::EndCapStyle::Flat, Qgis::JoinStyle::Miter, 5 ); + // QgsTesselator doesn't allow for coordinates distance smaller than 0.001 + geom.removeDuplicateNodes( 0.001 ); QgsPolygon *polygon = qgsgeometry_cast( geom.constGet() ); QgsTessellator t( 0, 0, false, false, false, true ); if ( points.size() > 2 && polygon )