Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[composer] Avoid some use of composition map settings
  • Loading branch information
nyalldawson committed Jan 14, 2017
1 parent 6ffe507 commit 7d2cd37
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/app/composer/qgscomposer.cpp
Expand Up @@ -3931,7 +3931,7 @@ void QgsComposer::cleanupAfterTemplateRead()
double currentHeight = mapItem->rect().height();
if ( currentWidth - 0 > 0.0 ) //don't divide through zero
{
QgsRectangle canvasExtent = mComposition->mapSettings().visibleExtent();
QgsRectangle canvasExtent = mQgis->mapCanvas()->mapSettings().visibleExtent();
//adapt min y of extent such that the size of the map item stays the same
double newCanvasExtentHeight = currentHeight / currentWidth * canvasExtent.width();
canvasExtent.setYMinimum( canvasExtent.yMaximum() - newCanvasExtentHeight );
Expand Down
2 changes: 1 addition & 1 deletion src/app/composer/qgscomposermapwidget.cpp
Expand Up @@ -469,7 +469,7 @@ void QgsComposerMapWidget::on_mSetToMapCanvasExtentButton_clicked()
return;
}

QgsRectangle newExtent = mComposerMap->composition()->mapSettings().visibleExtent();
QgsRectangle newExtent = QgisApp::instance()->mapCanvas()->mapSettings().visibleExtent();

mComposerMap->beginCommand( tr( "Map extent changed" ) );
mComposerMap->zoomToExtent( newExtent );
Expand Down

0 comments on commit 7d2cd37

Please sign in to comment.