Skip to content
Permalink
Browse files
[layouts] Fix polyline/polygon item nodes are incorrectly positioned
and scaled when using the move nodes tool

(cherry picked from commit 21f0a95)
  • Loading branch information
nyalldawson committed Aug 17, 2021
1 parent 95481a9 commit c38c15da1c48e5e9efd8b0234de87010d4c3e4b2
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/core/layout/qgslayoutitem.cpp
@@ -400,9 +400,10 @@ void QgsLayoutItem::paint( QPainter *painter, const QStyleOptionGraphicsItem *it
context.setExpressionContext( createExpressionContext() );
drawBackground( context );

const double viewScale = QgsLayoutUtils::scaleFactorFromItemStyle( itemStyle, painter );

// scale painter from mm to dots
painter->scale( 1.0 / context.scaleFactor(), 1.0 / context.scaleFactor() );
double viewScale = QgsLayoutUtils::scaleFactorFromItemStyle( itemStyle, painter );
QgsLayoutItemRenderContext itemRenderContext( context, viewScale );
draw( itemRenderContext );

0 comments on commit c38c15d

Please sign in to comment.