Skip to content
Permalink
Browse files

Added verification if LineString or MultiLineString patch shapes

Fixes #40525
  • Loading branch information
TurboGraphxBeige committed Dec 18, 2020
1 parent d6e2cd0 commit 1db15766cb18c8c6967bda437c7dc34489abe7f4
Showing with 5 additions and 2 deletions.
  1. +5 −2 src/core/layertree/qgslegendpatchshape.cpp
@@ -151,9 +151,12 @@ QList<QList<QPolygonF> > QgsLegendPatchShape::toQPolygonF( QgsSymbol::SymbolType
{
QList< QList<QPolygonF> > res;
const QgsGeometry patch = geom;
for ( auto it = patch.const_parts_begin(); it != patch.const_parts_end(); ++it )
if ( QgsWkbTypes::geometryType( mGeometry.wkbType() ) == QgsWkbTypes::LineGeometry )
{
res << ( QList< QPolygonF >() << curveToPolygonF( qgsgeometry_cast< const QgsCurve * >( *it ) ) );
for ( auto it = patch.const_parts_begin(); it != patch.const_parts_end(); ++it )
{
res << ( QList< QPolygonF >() << curveToPolygonF( qgsgeometry_cast< const QgsCurve * >( *it ) ) );
}
}
return res;
}

0 comments on commit 1db1576

Please sign in to comment.
You can’t perform that action at this time.