Skip to content

Commit

Permalink
Add const
Browse files Browse the repository at this point in the history
  • Loading branch information
lbartoletti committed Oct 3, 2017
1 parent 74e1221 commit 30d9ad8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/app/qgsmaptooladdrectangle.cpp
Expand Up @@ -93,7 +93,7 @@ QgsLineString *QgsMapToolAddRectangle::rectangleToLinestring( const bool isOrien
QgsPoint x1, x2, x3;
if ( isOriented )
{
double perpendicular = 90.0 * mSide;
const double perpendicular = 90.0 * mSide;
x1 = x0.project( mDistance1, mAzimuth );
x3 = x0.project( mDistance2, mAzimuth + perpendicular );
x2 = x1.project( mDistance2, mAzimuth + perpendicular );
Expand Down
5 changes: 3 additions & 2 deletions src/app/qgsmaptoolcircle2tangentspoint.cpp
Expand Up @@ -112,10 +112,10 @@ void QgsMapToolCircle2TangentsPoint::cadCanvasMoveEvent( QgsMapMouseEvent *e )
}

QgsPoint center = QgsPoint( mCenters.at( 0 ) );
double currentDist = mapPoint.distanceSquared( center );
const double currentDist = mapPoint.distanceSquared( center );
for ( int i = 1; i < mCenters.size(); ++i )
{
double testDist = mapPoint.distanceSquared( mCenters.at( i ).x(), mCenters.at( i ).y() );
const double testDist = mapPoint.distanceSquared( mCenters.at( i ).x(), mCenters.at( i ).y() );
if ( testDist < currentDist )
center = QgsPoint( mCenters.at( i ) );
}
Expand Down Expand Up @@ -264,6 +264,7 @@ void QgsMapToolCircle2TangentsPoint::radiusSpinBoxChanged( int radius )
std::unique_ptr<QgsMultiPolygonV2> rb( new QgsMultiPolygonV2() );
for ( int i = 0; i < mCenters.size(); ++i )
{
// TODO: Point instead of polygon?
std::unique_ptr<QgsGeometryRubberBand> tempRB( createGeometryRubberBand( ( mode() == CapturePolygon ) ? QgsWkbTypes::PolygonGeometry : QgsWkbTypes::LineGeometry, true ) );
tempRB->setGeometry( QgsCircle( QgsPoint( mCenters.at( i ) ), static_cast<int>( log10( mRadius ) ) + 1 ).toPolygon() );
tempRB->show();
Expand Down

0 comments on commit 30d9ad8

Please sign in to comment.