Skip to content
Permalink
Browse files

Adapt zoom to composer extent for multipage

  • Loading branch information
mhugent committed Jul 17, 2012
1 parent cb1ecad commit 19d64998f615c616eccfa9f9a7132e300b1357d7
Showing with 9 additions and 1 deletion.
  1. +7 −1 src/app/composer/qgscomposer.cpp
  2. +2 −0 src/core/composer/qgscomposition.h
@@ -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 );
}
}

@@ -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*/

0 comments on commit 19d6499

Please sign in to comment.
You can’t perform that action at this time.