Skip to content

Commit

Permalink
QgsRubberBand constructor fix (it is not possible to call constructor…
Browse files Browse the repository at this point in the history
… from constructor in C++ (<C++11)
  • Loading branch information
blazek committed Dec 21, 2012
1 parent d1795c0 commit 09b603d
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/gui/qgsrubberband.cpp
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

0 comments on commit 09b603d

Please sign in to comment.