From 7ee15ecdd960cde6d0202e9675f7f6bd31bbb927 Mon Sep 17 00:00:00 2001 From: Oleg Yadrov Date: Mon, 19 Dec 2016 12:08:20 -0800 Subject: PathAnimation: fix bug when PathSvg or PathLine is the last item in Path MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Both QQuickPathLine and QQuickPathSvg inherit QQuickCurve class which has “x” and “y” properties that return qreal type, but internally they are stored as QQmlNullableValue. 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 --- src/quick/util/qquickpath_p.h | 1 - 1 file changed, 1 deletion(-) (limited to 'src/quick/util/qquickpath_p.h') diff --git a/src/quick/util/qquickpath_p.h b/src/quick/util/qquickpath_p.h index 06ad389b49..c0a96cad4f 100644 --- a/src/quick/util/qquickpath_p.h +++ b/src/quick/util/qquickpath_p.h @@ -390,7 +390,6 @@ public: bool hasStartY() const; bool isClosed() const; - bool hasEnd() const; QPainterPath path() const; QStringList attributes() const; -- cgit v1.2.3