Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Adapt zoom to composer extent for multipage
  • Loading branch information
mhugent committed Jul 17, 2012
1 parent cb1ecad commit 19d6499
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/app/composer/qgscomposer.cpp
Expand Up @@ -478,7 +478,13 @@ void QgsComposer::zoomFull( void )
{
if ( mView )
{
mView->fitInView( 0, 0, mComposition->paperWidth() + 1, mComposition->paperHeight() + 1, Qt::KeepAspectRatio );
int nPages = mComposition->numPages();
if ( nPages < 1 )
{
return;
}
double height = mComposition->paperHeight() * nPages + mComposition->spaceBetweenPages() * ( nPages - 1 );
mView->fitInView( 0, 0, mComposition->paperWidth() + 1, height + 1, Qt::KeepAspectRatio );
}
}

Expand Down
2 changes: 2 additions & 0 deletions src/core/composer/qgscomposition.h
Expand Up @@ -79,6 +79,8 @@ class CORE_EXPORT QgsComposition: public QGraphicsScene
/**Returns width of paper item*/
double paperWidth() const;

double spaceBetweenPages() const { return mSpaceBetweenPages; }

/**Note: added in version 1.9*/
void setNumPages( int pages );
/**Note: added in version 1.9*/
Expand Down

0 comments on commit 19d6499

Please sign in to comment.