Skip to content
Permalink
Browse files

Add const

  • Loading branch information
lbartoletti committed Oct 3, 2017
1 parent 74e1221 commit 30d9ad8d3a7bab2ece61bbebb5cf73a935807d07
Showing with 4 additions and 3 deletions.
  1. +1 −1 src/app/qgsmaptooladdrectangle.cpp
  2. +3 −2 src/app/qgsmaptoolcircle2tangentspoint.cpp
@@ -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 );
@@ -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 ) );
}
@@ -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();

0 comments on commit 30d9ad8

Please sign in to comment.
You can’t perform that action at this time.