[Kst] branches/work/kst/portto4/kst/src/libkstapp

Mike Fenton mike at staikos.net
Thu Jul 23 14:59:48 CEST 2009


SVN commit 1001494 by fenton:

Fix plot drawing errors when plot's view rect strays from (0, 0)


 M  +8 -3      plotitem.cpp  


--- branches/work/kst/portto4/kst/src/libkstapp/plotitem.cpp #1001493:1001494
@@ -653,9 +653,14 @@
   QPixmap pixmap(rect().width()+1, rect().height()+1);
   pixmap.fill(Qt::transparent);
   QPainter pixmapPainter(&pixmap);
-
+  
+  pixmapPainter.save();
+  if (rect().topLeft() != QPointF(0, 0)) {
+    pixmapPainter.translate(-rect().topLeft());  
+  }
   paintPixmap(&pixmapPainter);
-
+  pixmapPainter.restore();
+  
   _plotPixmap = pixmap;
 #if BENCHMARK
   int i = bench_time.elapsed();
@@ -681,7 +686,7 @@
     painter->drawRect(rect());
     painter->restore();
 
-    painter->drawPixmap(QPointF(0, 0), _plotPixmap);
+    painter->drawPixmap(rect().topLeft(), _plotPixmap);
   }
 #if BENCHMARK
   int i = bench_time.elapsed();


More information about the Kst mailing list