Skip to content
Permalink
Browse files

Merge pull request #8271 from pblottiere/as_cancel_id

Fix map tool when auxiliary layer creation is canceled
  • Loading branch information
pblottiere committed Oct 23, 2018
2 parents 49e8e86 + 6df252a commit 9e82d4479567f6d4c8e6b91e3d28025e16048cfd
@@ -71,6 +71,12 @@ void QgsMapToolChangeLabelProperties::canvasPressEvent( QgsMapMouseEvent *e )
QgsPalIndexes indexes;
bool newAuxiliaryLayer = createAuxiliaryFields( indexes );

if ( !newAuxiliaryLayer && !mCurrentLabel.layer->auxiliaryLayer() )
{
deleteRubberBands();
return;
}

// in case of a new auxiliary layer, a dialog window is displayed and the
// canvas release event is lost.
if ( newAuxiliaryLayer )
@@ -57,13 +57,16 @@ void QgsMapToolMoveLabel::canvasPressEvent( QgsMapMouseEvent *e )

int xCol = -1, yCol = -1;

if ( !mCurrentLabel.pos.isDiagram && !labelMoveable( vlayer, mCurrentLabel.settings, xCol, yCol ) )
if ( !mCurrentLabel.pos.isDiagram && !labelMoveable( vlayer, mCurrentLabel.settings, xCol, yCol ) )
{
QgsPalIndexes indexes;

if ( createAuxiliaryFields( indexes ) )
return;

if ( !labelMoveable( vlayer, mCurrentLabel.settings, xCol, yCol ) )
return;

xCol = indexes[ QgsPalLayerSettings::PositionX ];
yCol = indexes[ QgsPalLayerSettings::PositionY ];
}
@@ -74,6 +77,9 @@ void QgsMapToolMoveLabel::canvasPressEvent( QgsMapMouseEvent *e )
if ( createAuxiliaryFields( indexes ) )
return;

if ( !diagramMoveable( vlayer, xCol, yCol ) )
return;

xCol = indexes[ QgsDiagramLayerSettings::PositionX ];
yCol = indexes[ QgsDiagramLayerSettings::PositionY ];
}
@@ -83,6 +83,9 @@ void QgsMapToolRotateLabel::canvasPressEvent( QgsMapMouseEvent *e )
QgsPalIndexes indexes;
if ( createAuxiliaryFields( indexes ) )
return;

if ( !labelIsRotatable( mCurrentLabel.layer, mCurrentLabel.settings, rotationCol ) )
return;
}

if ( currentLabelDataDefinedRotation( mCurrentRotation, hasRotationValue, rotationCol, true ) )

0 comments on commit 9e82d44

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