mirror of
https://github.com/mapmapteam/mapmap.git
synced 2026-06-16 12:33:19 +02:00
Added sanity check for ellipses (makes sure the points are ok).
This commit is contained in:
@@ -458,12 +458,10 @@ void Ellipse::setVertex(int i, const QPointF& v)
|
||||
// Center control point (make sure it stays inside!).
|
||||
else if (hasCenterControl())
|
||||
{
|
||||
// Map point as vector on a unit circle.
|
||||
QVector2D vector(toUnitCircle().map(v));
|
||||
|
||||
// Clip control point.
|
||||
Shape::setVertex(4, vector.length() <= 1 ?
|
||||
v :
|
||||
fromUnitCircle().map(vector.normalized().toPointF()));
|
||||
Shape::setVertex(4, clipInside(v));
|
||||
}
|
||||
|
||||
// Just to be sure.
|
||||
sanitize();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user