Skip to content

Commit 30d9ad8

Browse files
committedOct 3, 2017
Add const
1 parent 74e1221 commit 30d9ad8

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed
 

‎src/app/qgsmaptooladdrectangle.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ QgsLineString *QgsMapToolAddRectangle::rectangleToLinestring( const bool isOrien
9393
QgsPoint x1, x2, x3;
9494
if ( isOriented )
9595
{
96-
double perpendicular = 90.0 * mSide;
96+
const double perpendicular = 90.0 * mSide;
9797
x1 = x0.project( mDistance1, mAzimuth );
9898
x3 = x0.project( mDistance2, mAzimuth + perpendicular );
9999
x2 = x1.project( mDistance2, mAzimuth + perpendicular );

‎src/app/qgsmaptoolcircle2tangentspoint.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,10 @@ void QgsMapToolCircle2TangentsPoint::cadCanvasMoveEvent( QgsMapMouseEvent *e )
112112
}
113113

114114
QgsPoint center = QgsPoint( mCenters.at( 0 ) );
115-
double currentDist = mapPoint.distanceSquared( center );
115+
const double currentDist = mapPoint.distanceSquared( center );
116116
for ( int i = 1; i < mCenters.size(); ++i )
117117
{
118-
double testDist = mapPoint.distanceSquared( mCenters.at( i ).x(), mCenters.at( i ).y() );
118+
const double testDist = mapPoint.distanceSquared( mCenters.at( i ).x(), mCenters.at( i ).y() );
119119
if ( testDist < currentDist )
120120
center = QgsPoint( mCenters.at( i ) );
121121
}
@@ -264,6 +264,7 @@ void QgsMapToolCircle2TangentsPoint::radiusSpinBoxChanged( int radius )
264264
std::unique_ptr<QgsMultiPolygonV2> rb( new QgsMultiPolygonV2() );
265265
for ( int i = 0; i < mCenters.size(); ++i )
266266
{
267+
// TODO: Point instead of polygon?
267268
std::unique_ptr<QgsGeometryRubberBand> tempRB( createGeometryRubberBand( ( mode() == CapturePolygon ) ? QgsWkbTypes::PolygonGeometry : QgsWkbTypes::LineGeometry, true ) );
268269
tempRB->setGeometry( QgsCircle( QgsPoint( mCenters.at( i ) ), static_cast<int>( log10( mRadius ) ) + 1 ).toPolygon() );
269270
tempRB->show();

0 commit comments

Comments
 (0)
Please sign in to comment.