Skip to content

Commit

Permalink
Fix artefacts with map tool select rectangle
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed May 27, 2015
1 parent 2bd39e2 commit 9e59b6e
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/app/qgsmaptoolselectrectangle.cpp
Expand Up @@ -46,6 +46,7 @@ void QgsMapToolSelectFeatures::canvasPressEvent( QMouseEvent *e )
{
Q_UNUSED( e );
mSelectRect.setRect( 0, 0, 0, 0 );
delete mRubberBand;
mRubberBand = new QgsRubberBand( mCanvas, QGis::Polygon );
mRubberBand->setFillColor( mFillColor );
mRubberBand->setBorderColor( mBorderColour );
Expand All @@ -72,13 +73,9 @@ void QgsMapToolSelectFeatures::canvasReleaseEvent( QMouseEvent *e )
QgsVectorLayer* vlayer = QgsMapToolSelectUtils::getCurrentVectorLayer( mCanvas );
if ( vlayer == NULL )
{
if ( mRubberBand )
{
mRubberBand->reset( QGis::Polygon );
delete mRubberBand;
mRubberBand = 0;
mDragging = false;
}
delete mRubberBand;
mRubberBand = 0;
mDragging = false;
return;
}

Expand Down Expand Up @@ -117,7 +114,6 @@ void QgsMapToolSelectFeatures::canvasReleaseEvent( QMouseEvent *e )

delete selectGeom;

mRubberBand->reset( QGis::Polygon );
delete mRubberBand;
mRubberBand = 0;
}
Expand Down

0 comments on commit 9e59b6e

Please sign in to comment.