Skip to content

Commit

Permalink
[BUG][Mesh] Fix streamlines/traces issue when CRS transform fails
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Feb 28, 2020
1 parent f39caae commit 3bdeb05
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/core/mesh/qgsmeshtracerenderer.cpp
Original file line number Diff line number Diff line change
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 3bdeb05

Please sign in to comment.