@@ -40,8 +40,12 @@ QgsRubberBand::QgsRubberBand( QgsMapCanvas* mapCanvas, QGis::GeometryType geomet
40
40
41
41
QgsRubberBand::QgsRubberBand ( QgsMapCanvas* mapCanvas, bool isPolygon )
42
42
: QgsMapCanvasItem( mapCanvas )
43
+ , mWidth( 1 )
44
+ , mTranslationOffsetX( 0.0 )
45
+ , mTranslationOffsetY( 0.0 )
43
46
{
44
- QgsRubberBand ( mapCanvas, isPolygon ? QGis::Polygon : QGis::Line );
47
+ reset ( isPolygon ? QGis::Polygon : QGis::Line );
48
+ setColor ( QColor ( Qt::lightGray ) );
45
49
}
46
50
47
51
QgsRubberBand::QgsRubberBand (): QgsMapCanvasItem( 0 )
@@ -407,9 +411,9 @@ void QgsRubberBand::paint( QPainter* p )
407
411
mPen .setWidth ( 1 );
408
412
p->setPen ( mPen );
409
413
QVector<QPointF>::const_iterator ptIt = pts.constBegin ();
410
- for ( ; ptIt != pts.constEnd (); ++ptIt )
414
+ for ( ; ptIt != pts.constEnd (); ++ptIt )
411
415
{
412
- p->drawEllipse ( ( *ptIt).x () - mWidth / 2 , (*ptIt).y () - mWidth / 2 , mWidth , mWidth );
416
+ p->drawEllipse (( *ptIt ).x () - mWidth / 2 , ( *ptIt ).y () - mWidth / 2 , mWidth , mWidth );
413
417
}
414
418
}
415
419
break ;
@@ -496,7 +500,7 @@ QgsGeometry *QgsRubberBand::asGeometry()
496
500
{
497
501
QgsGeometry *geom = NULL ;
498
502
499
- switch ( mGeometryType )
503
+ switch ( mGeometryType )
500
504
{
501
505
case QGis::Polygon:
502
506
{
0 commit comments