Merge pull request #62535 from nyalldawson/backport_62488

Add (hidden) setting to force raster clip masks for layout exports (3.44 backport)
This commit is contained in:
Alexander Bruy 2025-07-08 09:32:00 +01:00 committed by GitHub
commit cf08ec10dd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 16 additions and 0 deletions

View File

@ -314,6 +314,7 @@ Layout graphical items for displaying a map.
%End
public:
enum AtlasScalingMode /BaseType=IntEnum/
{
Fixed,

View File

@ -314,6 +314,7 @@ Layout graphical items for displaying a map.
%End
public:
enum AtlasScalingMode
{
Fixed,

View File

@ -40,6 +40,7 @@
#include "qgslabelingresults.h"
#include "qgsvectortileutils.h"
#include "qgsunittypes.h"
#include "qgssettingstree.h"
#include <QApplication>
#include <QPainter>
@ -47,6 +48,8 @@
#include <QStyleOptionGraphicsItem>
#include <QTimer>
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
{

View File

@ -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)
*/