Skip to content
Permalink
Browse files

Fix for label buffer drawing triggered off of just its data defined s…

…ize in the past (<2.0)
  • Loading branch information
dakcarto committed May 24, 2013
1 parent 7083449 commit 8742a9e814f80260c9b7953996ea0127ac36edb5
Showing with 12 additions and 15 deletions.
  1. +12 −14 src/core/qgspallabeling.cpp
  2. +0 −1 src/core/qgspallabeling.h
@@ -233,7 +233,6 @@ QgsPalLayerSettings::QgsPalLayerSettings()

// text buffer
bufferDraw = false;
bufferDrawOld = false; // on when old style buffer triggered by just size is found
bufferSize = 1.0;
bufferSizeInMapUnits = false;
bufferColor = Qt::white;
@@ -755,6 +754,13 @@ void QgsPalLayerSettings::readDataDefinedProperty( QgsVectorLayer* layer,
{
//upgrade any existing property to field name-based
layer->setCustomProperty( newPropertyName, QVariant( updateDataDefinedString( ddString ) ) );

// fix for buffer drawing triggered off of just its data defined size in the past (<2.0)
if ( oldIndx == 7 ) // old bufferSize enum
{
bufferDraw = true;
layer->setCustomProperty( "labeling/bufferDraw", true );
}
}

// remove old-style field index-based property
@@ -849,7 +855,6 @@ void QgsPalLayerSettings::readFromLayer( QgsVectorLayer* layer )

// fix for buffer being keyed off of just its size in the past
QVariant drawBuffer = layer->customProperty( "labeling/bufferDraw", QVariant() );
bufferDrawOld = !drawBuffer.isValid();
if ( drawBuffer.isValid() )
{
bufferDraw = drawBuffer.toBool();
@@ -2511,25 +2516,18 @@ void QgsPalLayerSettings::parseTextBuffer()
drawBuffer = exprVal.toBool();
}

if ( !drawBuffer )
{
return;
}

// data defined buffer size?
double bufrSize = bufferSize;
if ( dataDefinedValEval( "doublepos", QgsPalLayerSettings::BufferSize, exprVal ) )
{
bufrSize = exprVal.toDouble();
}

// FIXME: find better solution for temporarily turning on buffer, when previously defined by size
// fix for buffer being keyed off of just its size in the past
// if ( bufrSize > 0.0 && bufferDrawOld )
// {
// drawBuffer = bufferDraw = true;
// }

if ( !drawBuffer )
{
return;
}

// data defined buffer transparency?
int bufTransp = bufferTransp;
if ( dataDefinedValEval( "transp", QgsPalLayerSettings::BufferTransp, exprVal ) )
@@ -307,7 +307,6 @@ class CORE_EXPORT QgsPalLayerSettings
//-- text buffer

bool bufferDraw;
bool bufferDrawOld; // on when old style buffer triggered by just size is found
double bufferSize; // buffer size
bool bufferSizeInMapUnits; //true if buffer is in map units (otherwise in mm)
QColor bufferColor;

0 comments on commit 8742a9e

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