Skip to content

Commit

Permalink
Snap to paper items and consider multipage compositions when showing …
Browse files Browse the repository at this point in the history
…snap lines
  • Loading branch information
mhugent committed Feb 12, 2013
1 parent f4c5bc8 commit b45d8cb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/core/composer/qgscomposeritem.cpp
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/core/composer/qgscomposition.cpp
Expand Up @@ -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;
}
Expand Down

0 comments on commit b45d8cb

Please sign in to comment.