Skip to content
Permalink
Browse files

Change default label buffer join style to round

Looks much nicer and is more appropriate for buffers

(cherry-picked from 4dbea7f)
  • Loading branch information
nyalldawson committed Sep 26, 2016
1 parent f9d258d commit 0ebf09ec4c98fa708f90521e3ed58bc32e24f10b
Showing with 5 additions and 4 deletions.
  1. +3 −3 src/core/qgspallabeling.cpp
  2. +2 −1 tests/src/python/test_qgspallabeling_base.py
@@ -151,7 +151,7 @@ QgsPalLayerSettings::QgsPalLayerSettings()
bufferColor = Qt::white;
bufferTransp = 0;
bufferNoFill = false;
bufferJoinStyle = Qt::BevelJoin;
bufferJoinStyle = Qt::RoundJoin;
bufferBlendMode = QPainter::CompositionMode_SourceOver;

// shape background
@@ -909,7 +909,7 @@ void QgsPalLayerSettings::readFromLayer( QgsVectorLayer* layer )
bufferTransp = layer->customProperty( "labeling/bufferTransp" ).toInt();
bufferBlendMode = QgsMapRenderer::getCompositionMode(
static_cast< QgsMapRenderer::BlendMode >( layer->customProperty( "labeling/bufferBlendMode", QVariant( QgsMapRenderer::BlendNormal ) ).toUInt() ) );
bufferJoinStyle = static_cast< Qt::PenJoinStyle >( layer->customProperty( "labeling/bufferJoinStyle", QVariant( Qt::BevelJoin ) ).toUInt() );
bufferJoinStyle = static_cast< Qt::PenJoinStyle >( layer->customProperty( "labeling/bufferJoinStyle", QVariant( Qt::RoundJoin ) ).toUInt() );
bufferNoFill = layer->customProperty( "labeling/bufferNoFill", QVariant( false ) ).toBool();

// background
@@ -1371,7 +1371,7 @@ void QgsPalLayerSettings::readXml( QDomElement& elem )
bufferTransp = textBufferElem.attribute( "bufferTransp" ).toInt();
bufferBlendMode = QgsMapRenderer::getCompositionMode(
static_cast< QgsMapRenderer::BlendMode >( textBufferElem.attribute( "bufferBlendMode", QString::number( QgsMapRenderer::BlendNormal ) ).toUInt() ) );
bufferJoinStyle = static_cast< Qt::PenJoinStyle >( textBufferElem.attribute( "bufferJoinStyle", QString::number( Qt::BevelJoin ) ).toUInt() );
bufferJoinStyle = static_cast< Qt::PenJoinStyle >( textBufferElem.attribute( "bufferJoinStyle", QString::number( Qt::RoundJoin ) ).toUInt() );
bufferNoFill = textBufferElem.attribute( "bufferNoFill", "0" ).toInt();

// background
@@ -29,7 +29,7 @@
import shutil
import tempfile

from qgis.PyQt.QtCore import QSize, qDebug
from qgis.PyQt.QtCore import QSize, qDebug, Qt
from qgis.PyQt.QtGui import QFont, QColor

from qgis.core import (
@@ -266,6 +266,7 @@ def defaultLayerSettings(self):
font.setPointSize(32)
lyr.textFont = font
lyr.textNamedStyle = 'Roman'
lyr.bufferJoinStyle = Qt.BevelJoin # handle change of default join style
return lyr

@staticmethod

0 comments on commit 0ebf09e

Please sign in to comment.