Skip to content

Commit

Permalink
Fix qgis#12023 : Prevent AA artifacts on polygon fill with NoPen style
Browse files Browse the repository at this point in the history
When NoPen option is selected and Anti-Aliasing is enabled, polygons
that share a boundary are bleeding out on each other, leading to an
unwanted artifact. In that situation we prefer to draw a very thin line with the
same color than the brush.
  • Loading branch information
troopa81 committed Dec 6, 2023
1 parent 0b4e023 commit b7a90fc
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/core/symbology/qgsfillsymbollayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,13 @@ void QgsSimpleFillSymbolLayer::renderPolygon( const QPolygonF &points, const QVe

applyDataDefinedSymbology( context, mBrush, mPen, mSelPen );

if ( mStrokeStyle == Qt::NoPen && fillColor.alpha() == 255 )
{
mPen.setStyle( Qt::SolidLine );
mPen.setWidthF( 0.2 );
mPen.setColor( fillColor );
}

QPointF offset = mOffset;

if ( mDataDefinedProperties.isActive( QgsSymbolLayer::PropertyOffset ) )
Expand Down

0 comments on commit b7a90fc

Please sign in to comment.