Skip to content

Commit

Permalink
[layouts] Fix polyline/polygon item nodes are incorrectly positioned
Browse files Browse the repository at this point in the history
and scaled when using the move nodes tool
  • Loading branch information
nyalldawson committed Aug 17, 2021
1 parent 7eafc43 commit 21f0a95
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/core/layout/qgslayoutitem.cpp
Expand Up @@ -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 );

Expand Down

0 comments on commit 21f0a95

Please sign in to comment.