Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Merge pull request #3147 from pblottiere/fix_diagram
[Bugfix] Fix pin/unpin maptool
- Loading branch information
Showing
with
7 additions
and
4 deletions.
-
+5
−1
src/app/qgsmaptoollabel.cpp
-
+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 ) ) |
|
|