Showing with 11 additions and 7 deletions.
  1. +8 −4 src/gui/qgsrubberband.cpp
  2. +1 −1 src/plugins/grass/qgsgrassplugin.cpp
  3. +2 −2 src/plugins/grass/qgsgrassregion.cpp
12 changes: 8 additions & 4 deletions src/gui/qgsrubberband.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,12 @@ QgsRubberBand::QgsRubberBand( QgsMapCanvas* mapCanvas, QGis::GeometryType geomet

QgsRubberBand::QgsRubberBand( QgsMapCanvas* mapCanvas, bool isPolygon )
: QgsMapCanvasItem( mapCanvas )
, mWidth( 1 )
, mTranslationOffsetX( 0.0 )
, mTranslationOffsetY( 0.0 )
{
QgsRubberBand( mapCanvas, isPolygon ? QGis::Polygon : QGis::Line );
reset( isPolygon ? QGis::Polygon : QGis::Line );
setColor( QColor( Qt::lightGray ) );
}

QgsRubberBand::QgsRubberBand(): QgsMapCanvasItem( 0 )
Expand Down Expand Up @@ -407,9 +411,9 @@ void QgsRubberBand::paint( QPainter* p )
mPen.setWidth( 1 );
p->setPen( mPen );
QVector<QPointF>::const_iterator ptIt = pts.constBegin();
for( ; ptIt != pts.constEnd(); ++ptIt )
for ( ; ptIt != pts.constEnd(); ++ptIt )
{
p->drawEllipse( (*ptIt).x() - mWidth/2, (*ptIt).y() - mWidth/2, mWidth, mWidth );
p->drawEllipse(( *ptIt ).x() - mWidth / 2, ( *ptIt ).y() - mWidth / 2, mWidth, mWidth );
}
}
break;
Expand Down Expand Up @@ -496,7 +500,7 @@ QgsGeometry *QgsRubberBand::asGeometry()
{
QgsGeometry *geom = NULL;

switch( mGeometryType )
switch ( mGeometryType )
{
case QGis::Polygon:
{
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/grass/qgsgrassplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ void QgsGrassPlugin::initGui()
connect( qgis, SIGNAL( newProject() ), this, SLOT( newProject() ) );

// Create region rubber band
mRegionBand = new QgsRubberBand( mCanvas, 1 );
mRegionBand = new QgsRubberBand( mCanvas, QGis::Polygon );
mRegionBand->setZValue( 20 );

// Create the action for tool (the icons are set later by calling setCurrentTheme)
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/grass/qgsgrassregion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ QgsGrassRegionEdit::QgsGrassRegionEdit( QgsMapCanvas* canvas )
: QgsMapTool( canvas )
{
mDraw = false;
mRubberBand = new QgsRubberBand( mCanvas, true );
mSrcRubberBand = new QgsRubberBand( mCanvas, true );
mRubberBand = new QgsRubberBand( mCanvas, QGis::Polygon );
mSrcRubberBand = new QgsRubberBand( mCanvas, QGis::Polygon );
QString gisdbase = QgsGrass::getDefaultGisdbase();
QString location = QgsGrass::getDefaultLocation();
mCrs = QgsGrass::crs( gisdbase, location );
Expand Down