Skip to content
Permalink
Browse files

avoid duplication of points in rubberbands of point geometry

  • Loading branch information
3nids committed Aug 14, 2013
1 parent 63cf5d3 commit bc58898bb3dcb9d304ed664fa42a5be177ae67f9
Showing with 6 additions and 3 deletions.
  1. +5 −2 src/gui/qgsrubberband.cpp
  2. +1 −1 src/gui/qgsrubberband.h
@@ -190,9 +190,9 @@ void QgsRubberBand::removePoint( int index, bool doUpdate/* = true*/, int geomet
}
}

void QgsRubberBand::removeLastPoint( int geometryIndex )
void QgsRubberBand::removeLastPoint( int geometryIndex, bool doUpdate/* = true*/ )
{
removePoint( -1, true, geometryIndex );
removePoint( -1, doUpdate, geometryIndex );
}

/*!
@@ -272,6 +272,7 @@ void QgsRubberBand::addGeometry( QgsGeometry* geom, QgsVectorLayer* layer )
pt = geom->asPoint();
}
addPoint( pt, false, idx );
removeLastPoint( idx , false );
}
break;

@@ -285,10 +286,12 @@ void QgsRubberBand::addGeometry( QgsGeometry* geom, QgsVectorLayer* layer )
if ( layer )
{
addPoint( mr->layerToMapCoordinates( layer, pt ), false, idx );
removeLastPoint( idx , false );
}
else
{
addPoint( pt, false, idx );
removeLastPoint( idx , false );
}
}
}
@@ -149,7 +149,7 @@ class GUI_EXPORT QgsRubberBand: public QgsMapCanvasItem
/**
* Removes the last point. Most useful in connection with undo operations
*/
void removeLastPoint( int geometryIndex = 0 );
void removeLastPoint( int geometryIndex = 0 , bool doUpdate = true );

/**
* Moves the rubber band point specified by index. Note that if the rubber band is

0 comments on commit bc58898

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