Skip to content

Commit 3c43bb5

Browse files
committedOct 12, 2016
Fix invalid values for @map_extent_width/height (fix #15672)
(cherry-picked from c1cf896)
1 parent b40b491 commit 3c43bb5

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed
 

‎src/core/qgsexpressioncontext.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -759,8 +759,8 @@ QgsExpressionContextScope* QgsExpressionContextUtils::mapSettingsScope( const Qg
759759
scope->addVariable( QgsExpressionContextScope::StaticVariable( "map_id", "canvas", true ) );
760760
scope->addVariable( QgsExpressionContextScope::StaticVariable( "map_rotation", mapSettings.rotation(), true ) );
761761
scope->addVariable( QgsExpressionContextScope::StaticVariable( "map_scale", mapSettings.scale(), true ) );
762-
scope->addVariable( QgsExpressionContextScope::StaticVariable( "map_extent_width", mapSettings.extent().width(), true ) );
763-
scope->addVariable( QgsExpressionContextScope::StaticVariable( "map_extent_height", mapSettings.extent().height(), true ) );
762+
scope->addVariable( QgsExpressionContextScope::StaticVariable( "map_extent_width", mapSettings.visibleExtent().width(), true ) );
763+
scope->addVariable( QgsExpressionContextScope::StaticVariable( "map_extent_height", mapSettings.visibleExtent().height(), true ) );
764764
QgsGeometry* centerPoint = QgsGeometry::fromPoint( mapSettings.visibleExtent().center() );
765765
scope->addVariable( QgsExpressionContextScope::StaticVariable( "map_extent_center", QVariant::fromValue( *centerPoint ), true ) );
766766
delete centerPoint;

‎tests/src/core/testqgs25drenderer.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ bool TestQgs25DRenderer::imageCheck( const QString& theTestType )
146146
//use the QgsRenderChecker test utility class to
147147
//ensure the rendered output matches our control image
148148
mMapSettings.setExtent( mpPolysLayer->extent() );
149+
mMapSettings.setOutputSize( QSize( 400, 400 ) );
149150
mMapSettings.setOutputDpi( 96 );
150151
QgsExpressionContext context;
151152
context << QgsExpressionContextUtils::mapSettingsScope( mMapSettings );

0 commit comments

Comments
 (0)
Please sign in to comment.