Skip to content
Permalink
Browse files

Added verification if LineString or MultiLineString patch shapes

Fixes #40525

(cherry picked from commit 1db1576)
  • Loading branch information
TurboGraphxBeige authored and nyalldawson committed Dec 18, 2020
1 parent 4808dd7 commit c2d02311a3504fb655f50e9b609af5a353c92755
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 c2d0231

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