Skip to content
Permalink
Browse files

Don`t change current visibility flag of rubberband on updates

  • Loading branch information
naihil committed Apr 1, 2015
1 parent a844bfa commit f11fdb044e0ad05fcb31f47781424fbb22d1733c
Showing with 7 additions and 1 deletion.
  1. +1 −1 src/gui/qgsrubberband.cpp
  2. +6 −0 tests/src/gui/testqgsrubberband.cpp
@@ -567,7 +567,7 @@ void QgsRubberBand::updateRect()
QgsRectangle rect( topLeft.x(), topLeft.y(), topLeft.x() + r.width()*res, topLeft.y() - r.height()*res );

setRect( rect );
setVisible( true );
setVisible( isVisible() );
}

void QgsRubberBand::updatePosition( )
@@ -128,6 +128,7 @@ void TestQgsRubberband::testBoundingRect()
mRubberband->setIconSize( 5 ); // default, but better be explicit
mRubberband->setWidth( 1 ); // default, but better be explicit
mRubberband->addGeometry( geom.data(), mPolygonLayer );
mRubberband->setVisible( true );

// 20 pixels for the extent + 3 for pen & icon per side + 2 of padding
QCOMPARE( mRubberband->boundingRect(), QRectF(QPointF(-1,-1),QSizeF(28,28)) );
@@ -151,6 +152,11 @@ void TestQgsRubberband::testBoundingRect()
mapSize.height() - ( 30 + 3 ) * 2
) );

// Check visibility after zoom
mRubberband->setVisible( false );
mCanvas->zoomIn();
QCOMPARE( mRubberband->isVisible(), false );

}


0 comments on commit f11fdb0

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