Skip to content

Commit

Permalink
Merge pull request #34782 from qgis-bot/backport-34765-to-release-3_12
Browse files Browse the repository at this point in the history
[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 4e6b042
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/core/mesh/qgsmeshtracerenderer.cpp
Expand Up @@ -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;
Expand Down Expand Up @@ -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 )
Expand Down

0 comments on commit 4e6b042

Please sign in to comment.