Skip to content

Commit

Permalink
Fix a transformation errors which occur when simplification is enabled
Browse files Browse the repository at this point in the history
for a vector layer with a custom crs in degrees
  • Loading branch information
nyalldawson committed Nov 29, 2021
1 parent 262bf11 commit c612a9a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/vector/qgsvectorlayerrenderer.cpp
Expand Up @@ -327,7 +327,7 @@ bool QgsVectorLayerRenderer::renderInternal( QgsFeatureRenderer *renderer )
try
{
QgsPointXY center = context.extent().center();
double rectSize = ct.sourceCrs().isGeographic() ? 0.0008983 /* ~100/(40075014/360=111319.4833) */ : 100;
double rectSize = ct.sourceCrs().mapUnits() == QgsUnitTypes::DistanceDegrees ? 0.0008983 /* ~100/(40075014/360=111319.4833) */ : 100;

QgsRectangle sourceRect = QgsRectangle( center.x(), center.y(), center.x() + rectSize, center.y() + rectSize );
QgsRectangle targetRect = ct.transform( sourceRect );
Expand Down

0 comments on commit c612a9a

Please sign in to comment.