Fixed QSGPaintedItem updates when a contentsScale is set.
authorYoann Lopes <yoann.lopes@nokia.com>
Thu, 18 Aug 2011 13:38:25 +0000 (15:38 +0200)
committerQt by Nokia <qt-info@nokia.com>
Wed, 24 Aug 2011 13:15:46 +0000 (15:15 +0200)
Change-Id: Iee9cd4503bcfdce39b6ee4beaccfed7da45cb8bc
Reviewed-on: http://codereview.qt.nokia.com/3192
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Yoann Lopes <yoann.lopes@nokia.com>
src/declarative/items/qsgpainteditem.cpp

index d4543c9..95aa2b4 100644 (file)
@@ -150,15 +150,10 @@ void QSGPaintedItem::update(const QRect &rect)
     Q_D(QSGPaintedItem);
     d->contentsDirty = true;
 
-    QRect srect(qCeil(rect.x()*d->contentsScale),
-            qCeil(rect.y()*d->contentsScale),
-            qCeil(rect.width()*d->contentsScale),
-            qCeil(rect.height()*d->contentsScale));
-
-    if (srect.isNull() && !d->dirtyRect.isNull())
+    if (rect.isNull() && !d->dirtyRect.isNull())
         d->dirtyRect = contentsBoundingRect().toAlignedRect();
     else
-        d->dirtyRect |= (contentsBoundingRect() & srect).toAlignedRect();
+        d->dirtyRect |= (contentsBoundingRect() & rect).toAlignedRect();
     QSGItem::update();
 }