Skip to content

Commit

Permalink
Fix restoration of painter antialiasing after rendering lines
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jul 24, 2020
1 parent 1f6e1b1 commit 4bfa75a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/core/symbology/qgslinesymbollayer.cpp
Expand Up @@ -337,7 +337,6 @@ void QgsSimpleLineSymbolLayer::renderPolyline( const QPolygonF &points, QgsSymbo
const QPen pen = context.selected() ? mSelPen : mPen;
p->setBrush( Qt::NoBrush );

const bool antialiasingWasEnabled = p->testRenderHint( QPainter::Antialiasing );
// Disable 'Antialiasing' if the geometry was generalized in the current RenderContext (We known that it must have least #2 points).
if ( points.size() <= 2 &&
( context.renderContext().vectorSimplifyMethod().simplifyHints() & QgsVectorSimplifyMethod::AntialiasingSimplification ) &&
Expand Down Expand Up @@ -393,7 +392,7 @@ void QgsSimpleLineSymbolLayer::renderPolyline( const QPolygonF &points, QgsSymbo
}
}

p->setRenderHint( QPainter::Antialiasing, antialiasingWasEnabled );
p->setRenderHint( QPainter::Antialiasing, context.renderContext().testFlag( QgsRenderContext::Antialiasing ) );
}

QgsStringMap QgsSimpleLineSymbolLayer::properties() const
Expand Down

0 comments on commit 4bfa75a

Please sign in to comment.