Skip to content
Permalink
Browse files

Ensure text format previews are antialiased

  • Loading branch information
nyalldawson committed Jul 7, 2020
1 parent f89fb2a commit 546777f14f0f068a877596cff48015d1199b4b09
Showing with 4 additions and 0 deletions.
  1. +1 −0 src/core/textrenderer/qgstextformat.cpp
  2. +1 −0 src/gui/qgsfontbutton.cpp
  3. +2 −0 src/gui/qgstextpreview.cpp
@@ -821,6 +821,7 @@ QPixmap QgsTextFormat::textFormatPreviewPixmap( const QgsTextFormat &format, QSi

context.setScaleFactor( QgsApplication::desktop()->logicalDpiX() / 25.4 );
context.setUseAdvancedEffects( true );
context.setFlag( QgsRenderContext::Antialiasing, true );
context.setPainter( &painter );

// slightly inset text to account for buffer/background
@@ -867,6 +867,7 @@ void QgsFontButton::updatePreview( const QColor &color, QgsTextFormat *format, Q

context.setScaleFactor( QgsApplication::desktop()->logicalDpiX() / 25.4 );
context.setUseAdvancedEffects( true );
context.setFlag( QgsRenderContext::Antialiasing, true );
context.setPainter( &p );

// slightly inset text to account for buffer/background
@@ -30,6 +30,8 @@ QgsTextPreview::QgsTextPreview( QWidget *parent )
mContext.setScaleFactor( QgsApplication::desktop()->logicalDpiX() / 25.4 );
mContext.setUseAdvancedEffects( true );

mContext.setFlag( QgsRenderContext::Antialiasing, true );

mContext.setIsGuiPreview( true );
}

0 comments on commit 546777f

Please sign in to comment.
You can’t perform that action at this time.