Skip to content

Commit

Permalink
Use simplifiedTypeRef in 2d geometry rendering
Browse files Browse the repository at this point in the history
This avoids unnecessary cloning/segmentation in some cases, e.g. if
a compound curve containing only a single linestring curve is rendered.
  • Loading branch information
nyalldawson committed May 24, 2021
1 parent adab3fe commit 859ade7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/core/symbology/qgssymbol.cpp
Expand Up @@ -1197,7 +1197,10 @@ void QgsSymbol::renderFeature( const QgsFeature &feature, QgsRenderContext &cont
}
};

getPartGeometry( geom.constGet(), 0 );
// Use the simplified type ref when rendering -- this avoids some unnecessary cloning/geometry modification
// (e.g. if the original geometry is a compound curve containing only a linestring curve, we don't have
// to segmentize the geometry before rendering)
getPartGeometry( geom.constGet()->simplifiedTypeRef(), 0 );

// step 2 - determine which layers to render
std::vector< int > layers;
Expand Down

0 comments on commit 859ade7

Please sign in to comment.