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

Mike Fenton mike at staikos.net
Fri Jan 9 18:20:22 CET 2009


SVN commit 908409 by fenton:

Drawing fixes associated with SharedAxisBoxItem's.
Automatically unshare when box is broken.


 M  +6 -0      plotitem.cpp  
 M  +4 -4      plotrenderitem.cpp  
 M  +3 -1      sharedaxisboxitem.cpp  


--- branches/work/kst/portto4/kst/src/libkstapp/plotitem.cpp #908408:908409
@@ -509,6 +509,12 @@
 
 
 void PlotItem::paint(QPainter *painter) {
+  if (isInSharedAxisBox()) {
+    setBrush(Qt::transparent);
+  } else {
+    setBrush(Qt::white);
+  }
+
   painter->save();
   painter->setPen(Qt::NoPen);
   painter->drawRect(rect());
--- branches/work/kst/portto4/kst/src/libkstapp/plotrenderitem.cpp #908408:908409
@@ -212,10 +212,10 @@
       painter->drawRect(_selectionRect.rect());
     }
 
-    painter->save();
-    painter->setRenderHint(QPainter::Antialiasing, true);
-    painter->fillPath(checkBox(), Qt::white);
     if (!plotItem()->isInSharedAxisBox()) {
+      painter->save();
+      painter->setRenderHint(QPainter::Antialiasing, true);
+      painter->fillPath(checkBox(), Qt::white);
       if (isHovering()) {
         QRectF check = checkBox().controlPointRect();
         check.setSize(QSizeF(check.width() / 1.8, check.height() / 1.8));
@@ -231,8 +231,8 @@
         painter->restore();
       }
       painter->drawPath(checkBox());
+      painter->restore();
     }
-    painter->restore();
   }
 
 #ifdef CURVE_DRAWING_TIME
--- branches/work/kst/portto4/kst/src/libkstapp/sharedaxisboxitem.cpp #908408:908409
@@ -112,7 +112,9 @@
       continue;
 
     if (PlotItem *plotItem = qobject_cast<PlotItem*>(viewItem)) {
-       plotItem->setSharedAxisBox(0);
+      plotItem->setSharedAxisBox(0);
+      plotItem->setLabelsVisible(true);
+      plotItem->update();
     }
   }
   if (_layout) {


More information about the Kst mailing list