Skip to content
Permalink
Browse files
Fix scalebar decoration in rotated map
Reset the map rotation before calculating the map width
  • Loading branch information
agiudiceandrea authored and nyalldawson committed Jul 21, 2021
1 parent 6d01b32 commit 64d40eff6e6ef0c0ac98649d0945580995e9774e
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/app/decorations/qgsdecorationscalebar.cpp
@@ -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();

0 comments on commit 64d40ef

Please sign in to comment.