autoSetLinked();
}
+QPointF &BPoint::operator[](int i)
+{
+ return i == 0 ? h1 : (i == 1 ? p : h2);
+}
+
+const QPointF &BPoint::operator[](int i) const
+{
+ return i == 0 ? h1 : (i == 1 ? p : h2);
+}
+
bool BPoint::operator==(const BPoint& point) const
{
return point.h1 == h1 &&
void BPoint::keepInRange(qreal xMin, qreal xMax)
{
+ Q_UNUSED(xMin);
+ Q_UNUSED(xMax);
}
void BPoint::autoSetLinked()
{
- handlesLinked = !QLineF(h1, p).angleTo(QLineF(p, h2));
+ // sometimes the angle is returned as 360°
+ // due to rounding problems the angle is sometimes not quite 0
+ qreal angle = QLineF(h1, p).angleTo(QLineF(p, h2));
+ handlesLinked = angle < 1e-3 || qRound(angle) == 360;
}