Skip to content
Permalink
Browse files

Merge pull request #3147 from pblottiere/fix_diagram

[Bugfix] Fix pin/unpin maptool
  • Loading branch information
3nids committed May 30, 2016
2 parents 72b55b7 + 62c814c commit 12cbcfc7fd529fe564eaaab825f87dc04d4d6763
Showing with 7 additions and 4 deletions.
  1. +5 −1 src/app/qgsmaptoollabel.cpp
  2. +2 −3 src/app/qgsmaptoolpinlabels.cpp
@@ -689,7 +689,11 @@ QgsMapToolLabel::LabelDetails::LabelDetails( const QgsLabelPosition& p )
if ( layer && layer->labeling() )
{
settings = layer->labeling()->settings( layer, pos.providerID );
valid = settings.enabled;

if ( p.isDiagram )
valid = layer->diagramsEnabled();
else
valid = settings.enabled;
}

if ( !valid )
@@ -239,8 +239,6 @@ void QgsMapToolPinLabels::pinUnpinLabels( const QgsRectangle& ext, QMouseEvent *
bool toggleUnpinOrPin = e->modifiers() & Qt::ControlModifier;

// get list of all drawn labels from all layers within, or touching, chosen extent
bool labelChanged = false;

const QgsLabelingResults* labelingResults = mCanvas->labelingResults();
if ( !labelingResults )
{
@@ -250,6 +248,7 @@ void QgsMapToolPinLabels::pinUnpinLabels( const QgsRectangle& ext, QMouseEvent *

QList<QgsLabelPosition> labelPosList = labelingResults->labelsWithinRect( ext );

bool labelChanged = false;
QList<QgsLabelPosition>::const_iterator it;
for ( it = labelPosList.constBegin() ; it != labelPosList.constEnd(); ++it )
{
@@ -284,7 +283,7 @@ void QgsMapToolPinLabels::pinUnpinLabels( const QgsRectangle& ext, QMouseEvent *
}
}
// pin label
if ( !isPinned() && ( !doUnpin || toggleUnpinOrPin ) )
else if ( !isPinned() && ( !doUnpin || toggleUnpinOrPin ) )
{
// pin label's location, and optionally rotation, to attribute table
if ( pinUnpinCurrentFeature( true ) )

0 comments on commit 12cbcfc

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