Skip to content
Permalink
Browse files
[layouts] Fix polyline/polygon item nodes are incorrectly positioned
and scaled when using the move nodes tool
  • Loading branch information
nyalldawson committed Aug 17, 2021
1 parent 7eafc43 commit 21f0a95503789c8d22d04d4612a60a2afe0a1cda
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() );
const double viewScale = QgsLayoutUtils::scaleFactorFromItemStyle( itemStyle, painter );
QgsLayoutItemRenderContext itemRenderContext( context, viewScale );
draw( itemRenderContext );

0 comments on commit 21f0a95

Please sign in to comment.