Skip to content

Commit

Permalink
[layouts] Fix computation of atlas rectangle for rotated map items wh…
Browse files Browse the repository at this point in the history
…en no atlas geometry available
  • Loading branch information
nirvn authored and nyalldawson committed Sep 14, 2024
1 parent 59bd89d commit 6d95bfe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/layout/qgslayoutitemmap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3015,7 +3015,7 @@ QgsRectangle QgsLayoutItemMap::computeAtlasRectangle()
// Note: we cannot directly take the transformation of the bounding box, since transformations are not linear
QgsGeometry g = mLayout->reportContext().currentGeometry( crs() );
// Rotating the geometry, so the bounding box is correct wrt map rotation
if ( mEvaluatedMapRotation != 0.0 )
if ( !g.boundingBox().isEmpty() && mEvaluatedMapRotation != 0.0 )
{
QgsPointXY prevCenter = g.boundingBox().center();
g.rotate( mEvaluatedMapRotation, g.boundingBox().center() );
Expand Down

0 comments on commit 6d95bfe

Please sign in to comment.