Added sanity check for ellipses (makes sure the points are ok).

This commit is contained in:
Tats
2014-03-02 22:29:36 -05:00
parent 07c6293dc7
commit 8256ace2e1
2 changed files with 72 additions and 16 deletions
+4 -6
View File
@@ -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();
}