Skip to content

Commit

Permalink
Avoid some bleed of masked features outside of layout map extent
Browse files Browse the repository at this point in the history
Partial fix for qgis#53542
  • Loading branch information
nyalldawson committed Jun 27, 2024
1 parent 5ac2172 commit 76a12b9
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/core/symbology/qgssymbollayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -976,12 +976,18 @@ QPainterPath generateClipPath( const QgsRenderContext &renderContext, const QStr
#endif
if ( !mergedGeom.isEmpty() )
{
const QgsGeometry exterior = rect
? QgsGeometry::fromRect( *rect )
: QgsGeometry::fromRect(
QgsRectangle( 0, 0,
renderContext.outputSize().width(),
renderContext.outputSize().height() ) );
QgsGeometry exterior;
const QgsRectangle contextBounds( 0, 0,
renderContext.outputSize().width(),
renderContext.outputSize().height() );
if ( rect )
{
exterior = QgsGeometry::fromRect( QgsRectangle( *rect ).intersect( contextBounds ) );
}
else
{
exterior = QgsGeometry::fromRect( contextBounds );
}
const QgsGeometry maskGeom = exterior.difference( mergedGeom );
if ( !maskGeom.isNull() )
{
Expand Down

0 comments on commit 76a12b9

Please sign in to comment.