Skip to content
Permalink
Browse files

Fix #10514 (snapping marker visible even if not snapped to anything)

  • Loading branch information
wonder-sk committed Jun 10, 2014
1 parent ff9356f commit f13f6ee10ca8959909abda4b26f26084945da1be
Showing with 16 additions and 8 deletions.
  1. +16 −8 src/app/qgsmaptoolcapture.cpp
@@ -108,14 +108,22 @@ void QgsMapToolCapture::canvasMoveEvent( QMouseEvent * e )
QList<QgsSnappingResult> snapResults;
if ( mSnapper.snapToBackgroundLayers( e->pos(), snapResults ) == 0 )
{
delete mSnappingMarker;

mSnappingMarker = new QgsVertexMarker( mCanvas );
mSnappingMarker->setIconType( QgsVertexMarker::ICON_CROSS );
mSnappingMarker->setColor( Qt::magenta );
mSnappingMarker->setPenWidth( 3 );
mSnappingMarker->setCenter( snapPointFromResults( snapResults, e->pos() ) );

if ( snapResults.isEmpty() )
{
delete mSnappingMarker;
mSnappingMarker = 0;
}
else
{
if ( !mSnappingMarker )
{
mSnappingMarker = new QgsVertexMarker( mCanvas );
mSnappingMarker->setIconType( QgsVertexMarker::ICON_CROSS );
mSnappingMarker->setColor( Qt::magenta );
mSnappingMarker->setPenWidth( 3 );
}
mSnappingMarker->setCenter( snapResults.constBegin()->snappedVertex );
}

if ( mCaptureMode != CapturePoint && mTempRubberBand && mCapturing )
{

0 comments on commit f13f6ee

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