summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-10-13 01:00:43 +0200
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-10-13 01:00:43 +0200
commit8d8140dffa9aa680a519b501fc5bdf08c91dd735 (patch)
tree346d255ca98fd79aaef9db84eac724a49285da1c /src/corelib/tools
parente55a79b022e542a482177c2f34140c23b100b708 (diff)
parenta90899df4330afccd8299fa81754f369e6d12344 (diff)
Merge remote-tracking branch 'origin/5.14' into 5.15
Diffstat (limited to 'src/corelib/tools')
-rw-r--r--src/corelib/tools/qeasingcurve.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/corelib/tools/qeasingcurve.cpp b/src/corelib/tools/qeasingcurve.cpp
index 2ae63fe135..52c8d13fe3 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: