Skip to content

Commit

Permalink
Change default label buffer join style to round
Browse files Browse the repository at this point in the history
Looks much nicer and is more appropriate for buffers
  • Loading branch information
nyalldawson committed Sep 23, 2016
1 parent e7c9400 commit 4dbea7f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/core/qgspallabeling.cpp
Expand Up @@ -150,7 +150,7 @@ QgsPalLayerSettings::QgsPalLayerSettings()
bufferColor = Qt::white;
bufferTransp = 0;
bufferNoFill = false;
bufferJoinStyle = Qt::BevelJoin;
bufferJoinStyle = Qt::RoundJoin;
bufferBlendMode = QPainter::CompositionMode_SourceOver;

// shape background
Expand Down Expand Up @@ -905,7 +905,7 @@ void QgsPalLayerSettings::readFromLayer( QgsVectorLayer* layer )
bufferTransp = layer->customProperty( "labeling/bufferTransp" ).toInt();
bufferBlendMode = QgsPainting::getCompositionMode(
static_cast< QgsPainting::BlendMode >( layer->customProperty( "labeling/bufferBlendMode", QVariant( QgsPainting::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
Expand Down Expand Up @@ -1367,7 +1367,7 @@ void QgsPalLayerSettings::readXml( QDomElement& elem )
bufferTransp = textBufferElem.attribute( "bufferTransp" ).toInt();
bufferBlendMode = QgsPainting::getCompositionMode(
static_cast< QgsPainting::BlendMode >( textBufferElem.attribute( "bufferBlendMode", QString::number( QgsPainting::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
Expand Down
3 changes: 2 additions & 1 deletion tests/src/python/test_qgspallabeling_base.py
Expand Up @@ -30,7 +30,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 (
Expand Down Expand Up @@ -260,6 +260,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
Expand Down

0 comments on commit 4dbea7f

Please sign in to comment.