[QGIS Commit] r8637 - branches/advanced_printing_branch/src/app/composer

svn_qgis at osgeo.org svn_qgis at osgeo.org
Tue Jun 10 06:17:45 EDT 2008


Author: mhugent
Date: 2008-06-10 06:17:45 -0400 (Tue, 10 Jun 2008)
New Revision: 8637

Modified:
   branches/advanced_printing_branch/src/app/composer/qgscomposeritem.cpp
Log:
Fix for problem with rubber band when moving items

Modified: branches/advanced_printing_branch/src/app/composer/qgscomposeritem.cpp
===================================================================
--- branches/advanced_printing_branch/src/app/composer/qgscomposeritem.cpp	2008-06-10 10:08:11 UTC (rev 8636)
+++ branches/advanced_printing_branch/src/app/composer/qgscomposeritem.cpp	2008-06-10 10:17:45 UTC (rev 8637)
@@ -82,13 +82,18 @@
 
       rectangleChange(diffX, diffY, mx, my, rx, ry);
       
-      //QRectF r = mBoundingResizeRectangle->rect();
-      //r.translate(mx, my);
       QRectF r = mBoundingResizeRectangle->rect();
-      r.setWidth(r.width() + rx);
-      r.setHeight(r.height() + ry);
-      mBoundingResizeRectangle->setRect(r);
-      mBoundingResizeRectangle->moveBy(mx, my);
+      double newWidth = r.width() + rx;
+      double newHeight = r.height() + ry;
+
+      QTransform oldTransform = mBoundingResizeRectangle->transform();
+      QTransform transform;
+      transform.translate(oldTransform.dx() + mx, oldTransform.dy() + my);
+      
+      QRectF newBoundingRect(0, 0, newWidth, newHeight);
+
+      mBoundingResizeRectangle->setRect(newBoundingRect);
+      mBoundingResizeRectangle->setTransform(transform);
     }
   mLastMouseEventPos = event->lastPos();
 }



More information about the QGIS-commit mailing list