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 22, 2021
1 parent 3164ede commit be5cb1f0344b9b9a31fb2f85841b2cafa33019ba
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 be5cb1f

Please sign in to comment.