Skip to content

Commit d91bd45

Browse files
committed
Take into account z dimension from center points
1 parent 12392f7 commit d91bd45

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/core/geometry/qgscircle.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ QgsCircle QgsCircle::fromCenterPoint( const QgsPoint &center, const QgsPoint &pt
183183
double azimuth = QgsGeometryUtils::lineAngle( center.x(), center.y(), pt1.x(), pt1.y() ) * 180.0 / M_PI;
184184

185185
QgsPoint centerPt( center );
186-
QgsGeometryUtils::setZValueFromPoints( QgsPointSequence() << pt1, centerPt );
186+
QgsGeometryUtils::setZValueFromPoints( QgsPointSequence() << center << pt1, centerPt );
187187

188188
return QgsCircle( centerPt, centerPt.distance( pt1 ), azimuth );
189189
}

src/core/geometry/qgsellipse.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ QgsEllipse QgsEllipse::fromCenterPoint( const QgsPoint &center, const QgsPoint &
8181
double azimuth = 90.0;
8282

8383
QgsPoint centerPt( center );
84-
QgsGeometryUtils::setZValueFromPoints( QgsPointSequence() << pt1, centerPt );
84+
QgsGeometryUtils::setZValueFromPoints( QgsPointSequence() << center << pt1, centerPt );
8585

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

9898
QgsPoint centerPt( center );
99-
QgsGeometryUtils::setZValueFromPoints( QgsPointSequence() << pt1 << pt2, centerPt );
99+
QgsGeometryUtils::setZValueFromPoints( QgsPointSequence() << center << pt1 << pt2, centerPt );
100100

101101
return QgsEllipse( centerPt, axis_a, axis_b, azimuth );
102102
}

0 commit comments

Comments
 (0)