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 6d01b32 commit 64d40ef
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/app/decorations/qgsdecorationscalebar.cpp
Expand Up @@ -210,7 +210,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 64d40ef

Please sign in to comment.