diff --git a/python/PyQt6/core/auto_generated/layout/qgslayoutitemmap.sip.in b/python/PyQt6/core/auto_generated/layout/qgslayoutitemmap.sip.in index 880a15027b9..66a7abfef09 100644 --- a/python/PyQt6/core/auto_generated/layout/qgslayoutitemmap.sip.in +++ b/python/PyQt6/core/auto_generated/layout/qgslayoutitemmap.sip.in @@ -314,6 +314,7 @@ Layout graphical items for displaying a map. %End public: + enum AtlasScalingMode /BaseType=IntEnum/ { Fixed, diff --git a/python/core/auto_generated/layout/qgslayoutitemmap.sip.in b/python/core/auto_generated/layout/qgslayoutitemmap.sip.in index f042e970d35..759356855f8 100644 --- a/python/core/auto_generated/layout/qgslayoutitemmap.sip.in +++ b/python/core/auto_generated/layout/qgslayoutitemmap.sip.in @@ -314,6 +314,7 @@ Layout graphical items for displaying a map. %End public: + enum AtlasScalingMode { Fixed, diff --git a/src/core/layout/qgslayoutitemmap.cpp b/src/core/layout/qgslayoutitemmap.cpp index 7d760d7f169..1766d0f8eec 100644 --- a/src/core/layout/qgslayoutitemmap.cpp +++ b/src/core/layout/qgslayoutitemmap.cpp @@ -40,6 +40,7 @@ #include "qgslabelingresults.h" #include "qgsvectortileutils.h" #include "qgsunittypes.h" +#include "qgssettingstree.h" #include #include @@ -47,6 +48,8 @@ #include #include +const QgsSettingsEntryBool *QgsLayoutItemMap::settingForceRasterMasks = new QgsSettingsEntryBool( QStringLiteral( "force-raster-masks" ), QgsSettingsTree::sTreeLayout, false, QStringLiteral( "Whether to force rasterised clipping masks, regardless of output format." ) ); + QgsLayoutItemMap::QgsLayoutItemMap( QgsLayout *layout ) : QgsLayoutItem( layout ) , mAtlasClippingSettings( new QgsLayoutItemMapAtlasClippingSettings( this ) ) @@ -1751,6 +1754,10 @@ QgsMapSettings QgsLayoutItemMap::mapSettings( const QgsRectangle &extent, QSizeF jobMapSettings.setSimplifyMethod( mLayout->renderContext().simplifyMethod() ); jobMapSettings.setMaskSettings( mLayout->renderContext().maskSettings() ); jobMapSettings.setRendererUsage( Qgis::RendererUsage::Export ); + if ( settingForceRasterMasks->value() ) + { + jobMapSettings.setFlag( Qgis::MapSettingsFlag::ForceRasterMasks, true ); + } } else { diff --git a/src/core/layout/qgslayoutitemmap.h b/src/core/layout/qgslayoutitemmap.h index 8da0c73f56a..3d0006d9a31 100644 --- a/src/core/layout/qgslayoutitemmap.h +++ b/src/core/layout/qgslayoutitemmap.h @@ -321,6 +321,13 @@ class CORE_EXPORT QgsLayoutItemMap : public QgsLayoutItem, public QgsTemporalRan public: + /** + * Settings entry - Whether to force rasterised clipping masks, regardless of output format. + * + * \since QGIS 4.0 + */ + static const QgsSettingsEntryBool *settingForceRasterMasks SIP_SKIP; + /** * Scaling modes used for the serial rendering (atlas) */