diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-10-14 01:00:34 +0200 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-10-14 01:00:34 +0200 |
commit | e164d61ca8263fc4b46fdd916e1ea77c7dd2b735 (patch) | |
tree | 06c50077b8baf41b756dc1aa8021c4a9ca34a9d4 /src/corelib/tools/qeasingcurve.cpp | |
parent | 721a0e807881e4d00e752e3c3cf62427eb681dd2 (diff) | |
parent | 8d8140dffa9aa680a519b501fc5bdf08c91dd735 (diff) |
Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: I129dd579f92cb2592a38ca043472b45cb926ae12
Diffstat (limited to 'src/corelib/tools/qeasingcurve.cpp')
-rw-r--r-- | src/corelib/tools/qeasingcurve.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/corelib/tools/qeasingcurve.cpp b/src/corelib/tools/qeasingcurve.cpp index 8e00c46b41..d7f69d3e0a 100644 --- a/src/corelib/tools/qeasingcurve.cpp +++ b/src/corelib/tools/qeasingcurve.cpp @@ -583,6 +583,13 @@ struct BezierEase : public QEasingCurveFunction qWarning("QEasingCurve: Invalid bezier curve"); return x; } + + // The bezier computation is not always precise on the endpoints, so handle explicitly + if (!(x > 0)) + return 0; + if (!(x < 1)) + return 1; + SingleCubicBezier *singleCubicBezier = 0; getBezierSegment(singleCubicBezier, x); @@ -998,6 +1005,11 @@ struct BackEase : public QEasingCurveFunction qreal value(qreal t) override { + // The *Back() functions are not always precise on the endpoints, so handle explicitly + if (!(t > 0)) + return 0; + if (!(t < 1)) + return 1; qreal o = (_o < 0) ? qreal(1.70158) : _o; switch(_t) { case QEasingCurve::InBack: |