Skip to content
Permalink
Browse files

Fix unbalanced painter save/restore for map items

  • Loading branch information
nyalldawson committed Dec 18, 2017
1 parent 7c8f4c3 commit cbc8570ae7c909c7793b41a114ab2903d1e60f08
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/core/layout/qgslayoutitemmap.cpp
@@ -886,6 +886,7 @@ void QgsLayoutItemMap::paint( QPainter *painter, const QStyleOptionGraphicsItem
painter->scale( 1 / dotsPerMM, 1 / dotsPerMM ); // scale painter from mm to dots
painter->drawImage( std::round( -tl.x()* dotsPerMM ), std::round( -tl.y() * dotsPerMM ), image );
painter->scale( dotsPerMM, dotsPerMM );
painter->restore();
}
else
{
@@ -895,6 +896,7 @@ void QgsLayoutItemMap::paint( QPainter *painter, const QStyleOptionGraphicsItem
drawMapBackground( painter );
}

painter->save();
painter->setClipRect( thisPaintRect );
painter->save();
painter->translate( mXOffset, mYOffset );
@@ -917,14 +919,13 @@ void QgsLayoutItemMap::paint( QPainter *painter, const QStyleOptionGraphicsItem
mGridStack->drawItems( painter );
}
drawAnnotations( painter );

painter->restore();
}

if ( shouldDrawPart( Frame ) )
{
drawMapFrame( painter );
}
painter->restore();
mDrawing = false;
}
}

0 comments on commit cbc8570

Please sign in to comment.
You can’t perform that action at this time.