diff options
author | Robin Burchell <robin.burchell@viroteck.net> | 2016-04-12 13:14:58 +0200 |
---|---|---|
committer | Robin Burchell <robin.burchell@viroteck.net> | 2016-04-13 07:05:35 +0000 |
commit | 81768d64fda69a7d464338660b552979b9e74b3a (patch) | |
tree | fed18e5796aef7c55cfa3e16f0ba2fc4f4e3cc23 /src | |
parent | f8c53e88ee45b7b545dfa2d98419a3f6066c7e5b (diff) |
QQuickItem: Ignore NaN x and y values.
These cause warnings, and incorrect rendering. We already guard width and height
against NaN, so doing the same with x & y seems like a sensible idea.
Change-Id: Ib33e51fe0beb9a2fa30fbf70743c8d6384a99441
Task-number: QTBUG-34489
Task-number: QTBUG-50604
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/quick/items/qquickitem.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp index 24e52ff65e..c363894a8b 100644 --- a/src/quick/items/qquickitem.cpp +++ b/src/quick/items/qquickitem.cpp @@ -6217,6 +6217,8 @@ QPointF QQuickItem::position() const void QQuickItem::setX(qreal v) { Q_D(QQuickItem); + if (qIsNaN(v)) + return; if (d->x == v) return; @@ -6232,6 +6234,8 @@ void QQuickItem::setX(qreal v) void QQuickItem::setY(qreal v) { Q_D(QQuickItem); + if (qIsNaN(v)) + return; if (d->y == v) return; |