ganeswidgets/src/hgqtquadrenderer.cpp
changeset 17 a10844a9914d
parent 5 4fa04caf0f43
child 20 a60f8b6b1d32
--- a/ganeswidgets/src/hgqtquadrenderer.cpp	Fri Sep 03 10:22:04 2010 +0300
+++ b/ganeswidgets/src/hgqtquadrenderer.cpp	Fri Sep 17 15:55:58 2010 +0300
@@ -156,7 +156,7 @@
         
     }
 
-    void draw(QPainter* painter, const QRectF& rect)    
+    void draw(QPainter* painter, const QRectF& rect, const QTransform& transform)    
     {
         if (!quad()->visible())
             return;
@@ -171,7 +171,7 @@
         if (image->pixmap().isNull())
             image = mRenderer->defaultImage();
         
-        drawImage(painter, image, rect);                      
+        drawImage(painter, image, rect, transform);                      
     }
 
     
@@ -196,7 +196,7 @@
         QTransform::quadToQuad(img, poly, tm);
     }
     
-    void drawImage(QPainter* painter, HgQtImage* image, const QRectF& rect)
+    void drawImage(QPainter* painter, HgQtImage* image, const QRectF& rect, const QTransform& transform)
     {
         const QPixmap& pixmap = image->pixmap();
         
@@ -219,10 +219,8 @@
         
         computeWarpMatrix(mTransform, image->width(), image->height(), points);
         
-        QTransform base = painter->transform(); 
-        painter->setTransform(mTransform * base);    
+        painter->setTransform(mTransform * transform);    
         painter->drawPixmap(QPointF(0,0), pixmap);
-        painter->setTransform(base);
     }
 
     HgQtQuadRenderer* mRenderer;
@@ -267,14 +265,15 @@
     {
         mIsReflection = true;
 
-        drawTransformedQuads(painter, rect);
-    
+        drawTransformedQuads(painter, rect, temp);    
+
+        painter->setTransform(temp);        
         drawFloor(painter, rect);
     }
     
     mIsReflection = false;
     
-    drawTransformedQuads(painter, rect);
+    drawTransformedQuads(painter, rect, temp);
         
     painter->setTransform(temp);