diff options
author | Martin Jones <martin.jones@nokia.com> | 2010-03-01 06:30:29 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2010-03-01 06:30:29 (GMT) |
commit | bec22cbfb255da34afe99c4cec30fc13cc40d900 (patch) | |
tree | 67e9e75d383657bf8c245e64ecb6a5add2d145e5 /src | |
parent | 7fed799b0ac8c472c99d28943ab9d8aae78a9836 (diff) | |
download | Qt-bec22cbfb255da34afe99c4cec30fc13cc40d900.zip Qt-bec22cbfb255da34afe99c4cec30fc13cc40d900.tar.gz Qt-bec22cbfb255da34afe99c4cec30fc13cc40d900.tar.bz2 |
Small optimizations.
Diffstat (limited to 'src')
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativeflickable_p_p.h | 6 | ||||
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativeitem.cpp | 8 |
2 files changed, 10 insertions, 4 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativeflickable_p_p.h b/src/declarative/graphicsitems/qdeclarativeflickable_p_p.h index 1ff4f92..ad7a04d 100644 --- a/src/declarative/graphicsitems/qdeclarativeflickable_p_p.h +++ b/src/declarative/graphicsitems/qdeclarativeflickable_p_p.h @@ -134,8 +134,10 @@ public: Velocity(QDeclarativeFlickablePrivate *p) : parent(p) {} virtual void setValue(qreal v) { - QDeclarativeTimeLineValue::setValue(v); - parent->updateVelocity(); + if (v != value()) { + QDeclarativeTimeLineValue::setValue(v); + parent->updateVelocity(); + } } QDeclarativeFlickablePrivate *parent; }; diff --git a/src/declarative/graphicsitems/qdeclarativeitem.cpp b/src/declarative/graphicsitems/qdeclarativeitem.cpp index c282808..f48c761 100644 --- a/src/declarative/graphicsitems/qdeclarativeitem.cpp +++ b/src/declarative/graphicsitems/qdeclarativeitem.cpp @@ -1730,8 +1730,12 @@ void QDeclarativeItem::geometryChanged(const QRectF &newGeometry, if (d->_anchors) d->_anchors->d_func()->updateMe(); - if (transformOrigin() != QDeclarativeItem::TopLeft) - setTransformOriginPoint(d->computeTransformOrigin()); + if (transformOrigin() != QDeclarativeItem::TopLeft + && (newGeometry.width() != oldGeometry.width() || newGeometry.height() != oldGeometry.height())) { + QPointF origin = d->computeTransformOrigin(); + if (transformOriginPoint() != origin) + setTransformOriginPoint(origin); + } if (newGeometry.x() != oldGeometry.x()) emit xChanged(); |