Skip to content
Permalink
Browse files

Remove some more QgsComposition::mapSettings use

  • Loading branch information
nyalldawson committed Jan 17, 2017
1 parent e3ad5b1 commit 308fc569ceb2c6f5c4d33a2245a8315455e8744d
Showing with 3 additions and 14 deletions.
  1. +1 −7 src/core/composer/qgscomposermapgrid.cpp
  2. +2 −7 src/core/composer/qgscomposermapoverview.cpp
@@ -636,14 +636,8 @@ void QgsComposerMapGrid::draw( QPainter* p )
p->scale( 1 / dotsPerMM, 1 / dotsPerMM ); //scale painter from mm to dots

//setup render context
QgsMapSettings ms = mComposerMap->composition()->mapSettings();
//context units should be in dots
ms.setOutputSize( QSizeF( mComposerMap->rect().width() * dotsPerMM, mComposerMap->rect().height() * dotsPerMM ).toSize() );
ms.setExtent( *mComposerMap->currentMapExtent() );
ms.setOutputDpi( p->device()->logicalDpiX() );
QgsRenderContext context = QgsRenderContext::fromMapSettings( ms );
QgsRenderContext context = QgsComposerUtils::createRenderContext( mComposition, *p );
context.setForceVectorOutput( true );
context.setPainter( p );
QgsExpressionContext expressionContext = createExpressionContext();
context.setExpressionContext( expressionContext );

@@ -22,6 +22,7 @@
#include "qgssymbol.h"
#include "qgsmapsettings.h"
#include "qgspainting.h"
#include "qgscomposerutils.h"

#include <QPainter>

@@ -91,14 +92,8 @@ void QgsComposerMapOverview::draw( QPainter *painter )
double dotsPerMM = painter->device()->logicalDpiX() / 25.4;

//setup render context
QgsMapSettings ms = mComposerMap->composition()->mapSettings();
//context units should be in dots
ms.setOutputSize( QSizeF( mComposerMap->rect().width() * dotsPerMM, mComposerMap->rect().height() * dotsPerMM ).toSize() );
ms.setExtent( *mComposerMap->currentMapExtent() );
ms.setOutputDpi( painter->device()->logicalDpiX() );
QgsRenderContext context = QgsRenderContext::fromMapSettings( ms );
QgsRenderContext context = QgsComposerUtils::createRenderContext( mComposition, *painter );
context.setForceVectorOutput( true );
context.setPainter( painter );
QgsExpressionContext expressionContext = createExpressionContext();
context.setExpressionContext( expressionContext );

0 comments on commit 308fc56

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