aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickitemanimation.cpp
diff options
context:
space:
mode:
authorOleg Yadrov <oleg.yadrov@qt.io>2016-12-19 12:08:20 -0800
committerOleg Yadrov <oleg.yadrov@qt.io>2017-01-20 00:13:24 +0000
commit7ee15ecdd960cde6d0202e9675f7f6bd31bbb927 (patch)
tree4d543697b552eada54971b7d0684e0495507e308 /src/quick/items/qquickitemanimation.cpp
parentedffdcf9b45641708fb242449b77e8e53ee05d87 (diff)
PathAnimation: fix bug when PathSvg or PathLine is the last item in Path
Both QQuickPathLine and QQuickPathSvg inherit QQuickCurve class which has “x” and “y” properties that return qreal type, but internally they are stored as QQmlNullableValue<qreal>. At the same time, if any of them is not specified explicitly, its getter returns 0. QQuickPath processes QQuickPath%Type% objects and produces a QPainterPath which later used by QQuickPathAnimation. QQuickPathAnimation only created a QAbstractAnimationJob if QQuickPath::hasEnd returned true, and hasEnd returned true only if both “x” and “y” were specified explicitly. All that in conjunction led to the situation when if you had either - a PathLine with unspecified “x” or “y”; or - a PathSvg which was the last (or the only) path element in your Path, PathAnimation would not start. This patch removes hasEnd check, it should be safe to do because QPainterPath is always valid anyway due to the fact QQuickCurve::x() and QQuickCurve::y() return 0 if they have not been not explicitly set. Task-number: QTBUG-57666 Change-Id: Id320aaeb5aff0964d6493b7b80d5d9a7d36acce8 Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
Diffstat (limited to 'src/quick/items/qquickitemanimation.cpp')
-rw-r--r--src/quick/items/qquickitemanimation.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/quick/items/qquickitemanimation.cpp b/src/quick/items/qquickitemanimation.cpp
index b33705e75e..9873622f41 100644
--- a/src/quick/items/qquickitemanimation.cpp
+++ b/src/quick/items/qquickitemanimation.cpp
@@ -869,7 +869,7 @@ QAbstractAnimationJob* QQuickPathAnimation::transition(QQuickStateActions &actio
data->reverse = direction == Backward ? true : false;
data->fromSourced = false;
data->fromDefined = (d->path && d->path->hasStartX() && d->path->hasStartY()) ? true : false;
- data->toDefined = d->path ? d->path->hasEnd() : false;
+ data->toDefined = d->path ? true : false;
int origModifiedSize = modified.count();
for (int i = 0; i < actions.count(); ++i) {