Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Take into account z dimension from center points
  • Loading branch information
pblottiere committed Feb 16, 2018
1 parent 12392f7 commit d91bd45
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/core/geometry/qgscircle.cpp
Expand Up @@ -183,7 +183,7 @@ QgsCircle QgsCircle::fromCenterPoint( const QgsPoint &center, const QgsPoint &pt
double azimuth = QgsGeometryUtils::lineAngle( center.x(), center.y(), pt1.x(), pt1.y() ) * 180.0 / M_PI;

QgsPoint centerPt( center );
QgsGeometryUtils::setZValueFromPoints( QgsPointSequence() << pt1, centerPt );
QgsGeometryUtils::setZValueFromPoints( QgsPointSequence() << center << pt1, centerPt );

return QgsCircle( centerPt, centerPt.distance( pt1 ), azimuth );
}
Expand Down
4 changes: 2 additions & 2 deletions src/core/geometry/qgsellipse.cpp
Expand Up @@ -81,7 +81,7 @@ QgsEllipse QgsEllipse::fromCenterPoint( const QgsPoint &center, const QgsPoint &
double azimuth = 90.0;

QgsPoint centerPt( center );
QgsGeometryUtils::setZValueFromPoints( QgsPointSequence() << pt1, centerPt );
QgsGeometryUtils::setZValueFromPoints( QgsPointSequence() << center << pt1, centerPt );

return QgsEllipse( centerPt, axis_a, axis_b, azimuth );
}
Expand All @@ -96,7 +96,7 @@ QgsEllipse QgsEllipse::fromCenter2Points( const QgsPoint &center, const QgsPoint
double axis_b = center.distance( pp );

QgsPoint centerPt( center );
QgsGeometryUtils::setZValueFromPoints( QgsPointSequence() << pt1 << pt2, centerPt );
QgsGeometryUtils::setZValueFromPoints( QgsPointSequence() << center << pt1 << pt2, centerPt );

return QgsEllipse( centerPt, axis_a, axis_b, azimuth );
}
Expand Down

0 comments on commit d91bd45

Please sign in to comment.