Skip to content
Permalink
Browse files

[composer] Avoid some use of composition map settings

  • Loading branch information
nyalldawson committed Jan 14, 2017
1 parent 6ffe507 commit 7d2cd371d8e6b88c4f7e263b4cacf1d3b2528a44
Showing with 2 additions and 2 deletions.
  1. +1 −1 src/app/composer/qgscomposer.cpp
  2. +1 −1 src/app/composer/qgscomposermapwidget.cpp
@@ -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 );
@@ -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 );

0 comments on commit 7d2cd37

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