Skip to content

Commit

Permalink
wip use page as item parent
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jul 25, 2017
1 parent 76b8ba7 commit 8fa173b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/core/layout/qgslayoutitem.cpp
Expand Up @@ -78,7 +78,7 @@ void QgsLayoutItem::paint( QPainter *painter, const QStyleOptionGraphicsItem *it
}

double destinationDpi = itemStyle->matrix.m11() * 25.4;
bool useImageCache = true;
bool useImageCache = false;

if ( useImageCache )
{
Expand Down Expand Up @@ -224,7 +224,10 @@ void QgsLayoutItem::setScenePos( const QPointF &destinationPos )
//since setPos does not account for item rotation, use difference between
//current scenePos (which DOES account for rotation) and destination pos
//to calculate how much the item needs to move
setPos( pos() + ( destinationPos - scenePos() ) );
if ( parentItem() )
setPos( pos() + ( destinationPos - scenePos() ) + parentItem()->scenePos() );
else
setPos( pos() + ( destinationPos - scenePos() ) );
}

double QgsLayoutItem::itemRotation() const
Expand Down

0 comments on commit 8fa173b

Please sign in to comment.