Skip to content
Permalink
Browse files

Merge pull request #34782 from qgis-bot/backport-34765-to-release-3_12

[Backport release-3_12] [BUG][Mesh] Fix streamlines/traces issue when CRS transform fails
  • Loading branch information
rouault committed Mar 11, 2020
2 parents d5aaf85 + 3bdeb05 commit 4e6b042d9a1f27d2ee5bd0043a35d1a500eb1268
Showing with 12 additions and 3 deletions.
  1. +12 −3 src/core/mesh/qgsmeshtracerenderer.cpp
@@ -259,7 +259,8 @@ void QgsMeshStreamField::updateSize( const QgsRenderContext &renderContext )
catch ( QgsCsException &cse )
{
Q_UNUSED( cse );
layerExtent = mLayerExtent;
//if the transform fails, consider the whole map
layerExtent = mMapExtent;
}

QgsRectangle interestZoneExtent;
@@ -298,8 +299,16 @@ void QgsMeshStreamField::updateSize( const QgsRenderContext &renderContext )
if ( fieldHeightInDeviceCoordinate % mFieldResolution > 0 )
fieldHeight++;

mFieldSize.setWidth( fieldWidth );
mFieldSize.setHeight( fieldHeight );
if ( fieldWidth == 0 || fieldHeight == 0 )
{
mFieldSize = QSize();
}
else
{
mFieldSize.setWidth( fieldWidth );
mFieldSize.setHeight( fieldHeight );
}


double mapUnitPerFieldPixel;
if ( interestZoneExtent.width() > 0 )

0 comments on commit 4e6b042

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