Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Make move callout tool play nice with CAD dock
Means that if the cad dock is enabled, callout lines will auto-snap
to nice angles, etc.
- Loading branch information
|
@@ -131,6 +131,11 @@ void QgsMapToolMoveLabel::cadCanvasPressEvent( QgsMapMouseEvent *e ) |
|
|
mCalloutMoveRubberBand->setWidth( 3 ); |
|
|
mCalloutMoveRubberBand->show(); |
|
|
|
|
|
// set initial cad point as the other side of the callout -- NOTE we have to add two points here! |
|
|
cadDockWidget()->addPoint( mCurrentCalloutMoveOrigin ? mCurrentCallout.destination() : mCurrentCallout.origin() ); |
|
|
cadDockWidget()->addPoint( e->mapPoint() ); |
|
|
cadDockWidget()->releaseLocks( false ); |
|
|
|
|
|
return; |
|
|
} |
|
|
else |
|
@@ -348,6 +353,14 @@ void QgsMapToolMoveLabel::cadCanvasReleaseEvent( QgsMapMouseEvent * ) |
|
|
} |
|
|
} |
|
|
|
|
|
void QgsMapToolMoveLabel::canvasReleaseEvent( QgsMapMouseEvent *e ) |
|
|
{ |
|
|
if ( mCalloutMoveRubberBand ) |
|
|
return; // don't allow cad dock widget points to be cleared after starting to move a callout endpoint |
|
|
|
|
|
QgsMapToolLabel::canvasReleaseEvent( e ); |
|
|
} |
|
|
|
|
|
void QgsMapToolMoveLabel::keyPressEvent( QKeyEvent *e ) |
|
|
{ |
|
|
if ( mLabelRubberBand || mCalloutMoveRubberBand ) |
|
|
|
@@ -35,6 +35,7 @@ class APP_EXPORT QgsMapToolMoveLabel: public QgsMapToolLabel |
|
|
void cadCanvasMoveEvent( QgsMapMouseEvent *e ) override; |
|
|
void cadCanvasPressEvent( QgsMapMouseEvent *e ) override; |
|
|
void cadCanvasReleaseEvent( QgsMapMouseEvent *e ) override; |
|
|
void canvasReleaseEvent( QgsMapMouseEvent *e ) override; |
|
|
void keyPressEvent( QKeyEvent *e ) override; |
|
|
void keyReleaseEvent( QKeyEvent *e ) override; |
|
|
|
|
|