Skip to content
Permalink
Browse files
Snap to paper items and consider multipage compositions when showing …
…snap lines
  • Loading branch information
mhugent committed Feb 12, 2013
1 parent f4c5bc8 commit b45d8cb0d75763b337b58b42cc1546188378e8ce
Showing with 8 additions and 2 deletions.
  1. +7 −1 src/core/composer/qgscomposeritem.cpp
  2. +1 −1 src/core/composer/qgscomposition.cpp
@@ -639,7 +639,13 @@ void QgsComposerItem::changeItemRectangle( const QPointF& currentPosition,
if ( alignX != -1 )
{
QGraphicsLineItem* item = hAlignSnapItem();
item->setLine( QLineF( alignX, 0, alignX, mComposition->paperHeight() ) );
int numPages = mComposition->numPages();
double yLineCoord = 300; //default in case there is no single page
if ( numPages > 0 )
{
yLineCoord = mComposition->paperHeight() * numPages + mComposition->spaceBetweenPages() * ( numPages - 1 );
}
item->setLine( QLineF( alignX, 0, alignX, yLineCoord ) );
item->show();
}
else
@@ -1735,7 +1735,7 @@ void QgsComposition::collectAlignCoordinates( QMap< double, const QgsComposerIte
const QgsComposerItem* currentItem = dynamic_cast<const QgsComposerItem *>( *itemIt );
if ( excludeItem )
{
if ( !currentItem || currentItem == excludeItem || currentItem->type() == QgsComposerItem::ComposerPaper )
if ( !currentItem || currentItem == excludeItem )
{
continue;
}

0 comments on commit b45d8cb

Please sign in to comment.