Skip to content

Commit

Permalink
Fix scalebar decoration in rotated map
Browse files Browse the repository at this point in the history
Reset the map rotation before calculating the map width
  • Loading branch information
agiudiceandrea authored and nyalldawson committed Jul 21, 2021
1 parent 3e1bbba commit b496e50
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/app/decorations/qgsdecorationscalebar.cpp
Expand Up @@ -212,7 +212,9 @@ void QgsDecorationScaleBar::setupScaleBar()

double QgsDecorationScaleBar::mapWidth( const QgsMapSettings &settings ) const
{
const QgsRectangle mapExtent = settings.visibleExtent();
QgsMapSettings ms = settings;
ms.setRotation( 0 );
const QgsRectangle mapExtent = ms.visibleExtent();
if ( mSettings.units() == QgsUnitTypes::DistanceUnknownUnit )
{
return mapExtent.width();
Expand Down

0 comments on commit b496e50

Please sign in to comment.