Skip to content
Permalink
Browse files
QgsRubberBand constructor fix (it is not possible to call constructor…
… from constructor in C++ (<C++11)
  • Loading branch information
blazek committed Dec 21, 2012
1 parent d1795c0 commit 09b603df133d8b8f29283b54d295633aebb1ca94
Showing with 8 additions and 4 deletions.
  1. +8 −4 src/gui/qgsrubberband.cpp
@@ -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 )
@@ -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;
@@ -496,7 +500,7 @@ QgsGeometry *QgsRubberBand::asGeometry()
{
QgsGeometry *geom = NULL;

switch( mGeometryType )
switch ( mGeometryType )
{
case QGis::Polygon:
{

0 comments on commit 09b603d

Please sign in to comment.