mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-15 00:04:00 -04:00
Fix invalid values for @map_extent_width/height (fix #15672)
This commit is contained in:
parent
e69dd9c9b2
commit
c1cf896c1a
@ -779,8 +779,8 @@ QgsExpressionContextScope* QgsExpressionContextUtils::mapSettingsScope( const Qg
|
||||
scope->addVariable( QgsExpressionContextScope::StaticVariable( "map_id", "canvas", true ) );
|
||||
scope->addVariable( QgsExpressionContextScope::StaticVariable( "map_rotation", mapSettings.rotation(), true ) );
|
||||
scope->addVariable( QgsExpressionContextScope::StaticVariable( "map_scale", mapSettings.scale(), true ) );
|
||||
scope->addVariable( QgsExpressionContextScope::StaticVariable( "map_extent_width", mapSettings.extent().width(), true ) );
|
||||
scope->addVariable( QgsExpressionContextScope::StaticVariable( "map_extent_height", mapSettings.extent().height(), true ) );
|
||||
scope->addVariable( QgsExpressionContextScope::StaticVariable( "map_extent_width", mapSettings.visibleExtent().width(), true ) );
|
||||
scope->addVariable( QgsExpressionContextScope::StaticVariable( "map_extent_height", mapSettings.visibleExtent().height(), true ) );
|
||||
QgsGeometry centerPoint = QgsGeometry::fromPoint( mapSettings.visibleExtent().center() );
|
||||
scope->addVariable( QgsExpressionContextScope::StaticVariable( "map_extent_center", QVariant::fromValue( centerPoint ), true ) );
|
||||
|
||||
|
@ -146,6 +146,7 @@ bool TestQgs25DRenderer::imageCheck( const QString& theTestType )
|
||||
//use the QgsRenderChecker test utility class to
|
||||
//ensure the rendered output matches our control image
|
||||
mMapSettings.setExtent( mpPolysLayer->extent() );
|
||||
mMapSettings.setOutputSize( QSize( 400, 400 ) );
|
||||
mMapSettings.setOutputDpi( 96 );
|
||||
QgsExpressionContext context;
|
||||
context << QgsExpressionContextUtils::mapSettingsScope( mMapSettings );
|
||||
|
Loading…
x
Reference in New Issue
Block a user