Skip to content
Permalink
Browse files

Rotate geometry before calculating bounding box in atlas. Fixes #11954

  • Loading branch information
Zverik committed Jun 14, 2017
1 parent e957224 commit e03b5630a9c237be5f1ba0b88fd3c046e6987968
Showing with 6 additions and 2 deletions.
  1. +6 −2 src/core/composer/qgsatlascomposition.cpp
@@ -436,9 +436,13 @@ bool QgsAtlasComposition::prepareForFeature( const int featureI, const bool upda
void QgsAtlasComposition::computeExtent( QgsComposerMap *map )
{
// QgsGeometry::boundingBox is expressed in the geometry"s native CRS
// We have to transform the grometry to the destination CRS and ask for the bounding box
// We have to transform the geometry to the destination CRS and ask for the bounding box
// Note: we cannot directly take the transformation of the bounding box, since transformations are not linear
mTransformedFeatureBounds = currentGeometry( map->crs() ).boundingBox();
QgsGeometry g(currentGeometry( map->crs() ));
// Rotating the geometry, so the bounding box is correct wrt map rotation
if ( map->mapRotation() != 0.0 )
g.rotate(map->mapRotation(), g.centroid().asPoint());
mTransformedFeatureBounds = g.boundingBox();
}

void QgsAtlasComposition::prepareMap( QgsComposerMap *map )

0 comments on commit e03b563

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