Details
-
Bug
-
Resolution: Done
-
P2: Important
-
None
-
5.11
-
None
Description
The following should be a valid curve, but returns nan for any progress:
QEasingCurve curve(QEasingCurve::BezierSpline); curve.addCubicBezierSegment(QPointF(1.0/3.0, 0.0), QPointF(1.0-1.0/3.0, 1.0), QPointF(1.0, 1.0)); qDebug() << test.valueForProgress(0.35);
The problem is that BezierEase::findTForX divides by factorT3, which is zero when the distance between the control points is 1/3 of the distance between the endpoints.
There are also likely issues in cases where the points are distanced such that factorT3 = factorT2 = factorT1 = 0, or the equation is quadratic and the discriminant is less than zero.
Attachments
Issue Links
- relates to
-
QTBUG-72630 Wrong value from BezierSpline QEasingCurve
- Closed
For Gerrit Dashboard: QTBUG-67061 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
223230,3 | Animation: Fix case where QEasingCurve::valueForProgress returns nan | 5.11 | qt/qtbase | Status: MERGED | +2 | 0 |