Skip to content

Commit

Permalink
Fixes a regression in qgsmaptoolcapture introduced by #58755 which
Browse files Browse the repository at this point in the history
broke snapping in non feature digitizing tools e.g. annotation
digitizing tools if there was no active layer or active layer was not
spatial.
  • Loading branch information
benwirf authored and 3nids committed Jan 17, 2025
1 parent 25bbcf4 commit f3d7514
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/gui/maptools/qgsmaptoolcapture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -492,11 +492,15 @@ void QgsMapToolCapture::setCurrentShapeMapTool( const QgsMapToolShapeMetadata *s

void QgsMapToolCapture::cadCanvasMoveEvent( QgsMapMouseEvent *e )
{
// If we are adding a record to a non-spatial layer, just return
if ( mCaptureModeFromLayer && !canvas()->currentLayer()->isSpatial() )
return;

QgsMapToolAdvancedDigitizing::cadCanvasMoveEvent( e );

const QgsPointXY point = e->mapPoint();
if ( canvas()->currentLayer() && canvas()->currentLayer()->isSpatial() )
mSnapIndicator->setMatch( e->mapPointMatch() );

mSnapIndicator->setMatch( e->mapPointMatch() );

if ( mCurrentCaptureTechnique == Qgis::CaptureTechnique::Shape )
{
Expand Down

0 comments on commit f3d7514

Please sign in to comment.