Skip to content

Commit

Permalink
- Increases the number of segments for QgsMapToolAddEllipse
Browse files Browse the repository at this point in the history
  • Loading branch information
lbartoletti committed Oct 9, 2017
1 parent 34433ae commit 00e12bc
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/app/qgsmaptooladdellipse.cpp
Expand Up @@ -66,7 +66,7 @@ void QgsMapToolAddEllipse::deactivate()
}

mParentTool->clearCurve();
mParentTool->addCurve( mEllipse.toLineString() );
mParentTool->addCurve( mEllipse.toLineString( segments() ) );
clean();

QgsMapToolCapture::deactivate();
Expand Down
3 changes: 3 additions & 0 deletions src/app/qgsmaptooladdellipse.h
Expand Up @@ -18,6 +18,7 @@

#include "qgsmaptoolcapture.h"
#include "qgsellipse.h"
#include "qgssettings.h"

class QgsGeometryRubberBand;

Expand Down Expand Up @@ -49,6 +50,8 @@ class QgsMapToolAddEllipse: public QgsMapToolCapture
QgsGeometryRubberBand *mTempRubberBand = nullptr;
//! Ellipse
QgsEllipse mEllipse;
//! convenient method to return the number of segments
unsigned int segments( ) { return QgsSettings().value( QStringLiteral( "/qgis/digitizing/offset_quad_seg" ), 8 ).toInt() * 12; }

private:
//! convenient method to clean members
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsmaptoolellipsecenter2points.cpp
Expand Up @@ -73,7 +73,7 @@ void QgsMapToolEllipseCenter2Points::cadCanvasMoveEvent( QgsMapMouseEvent *e )
case 2:
{
mEllipse = QgsEllipse().fromCenter2Points( mPoints.at( 0 ), mPoints.at( 1 ), mapPoint );
mTempRubberBand->setGeometry( mEllipse.toPolygon() );
mTempRubberBand->setGeometry( mEllipse.toPolygon( segments() ) );
}
break;
default:
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsmaptoolellipsecenterpoint.cpp
Expand Up @@ -56,6 +56,6 @@ void QgsMapToolEllipseCenterPoint::cadCanvasMoveEvent( QgsMapMouseEvent *e )
if ( mTempRubberBand )
{
mEllipse = QgsEllipse().fromCenterPoint( mPoints.at( 0 ), mapPoint );
mTempRubberBand->setGeometry( mEllipse.toPolygon() );
mTempRubberBand->setGeometry( mEllipse.toPolygon( segments() ) );
}
}
2 changes: 1 addition & 1 deletion src/app/qgsmaptoolellipseextent.cpp
Expand Up @@ -63,7 +63,7 @@ void QgsMapToolEllipseExtent::cadCanvasMoveEvent( QgsMapMouseEvent *e )
if ( qgsDoubleNear( mCanvas->rotation(), 0.0 ) )
{
mEllipse = QgsEllipse().fromExtent( mPoints.at( 0 ), mapPoint );
mTempRubberBand->setGeometry( mEllipse.toPolygon() );
mTempRubberBand->setGeometry( mEllipse.toPolygon( segments() ) );
}
else
{
Expand Down

0 comments on commit 00e12bc

Please sign in to comment.