[Kst] extragear/graphics/kst/kst

Rick Chern rchern at interchange.ubc.ca
Fri Aug 19 22:00:46 CEST 2005


SVN commit 451066 by rchern:

Get clipregion correctly for plotgroups

 M  +15 -11    kstplotgroup.cpp  
 M  +2 -0      kstplotgroup.h  


--- trunk/extragear/graphics/kst/kst/kstplotgroup.cpp #451065:451066
@@ -154,18 +154,9 @@
     setBorderWidth(0);
   }
 
-  QRegion clipRegion;
-  
-  if (transparent()) {
-    // make the clipregion just the children
-    for (KstViewObjectList::Iterator i = _children.begin(); i != _children.end(); ++i) {
-      clipRegion += (*i)->clipRegion();
-    }
-    QRegion oldRegion = p.clipRegion();
-    p.setClipRegion(clipRegion + oldRegion);
-  } else {
+  if (!transparent()) {
     // fill non-children areas with color
-    clipRegion = QRegion(geometry());
+    QRegion clipRegion = QRegion(geometry());
     QBrush brush(_backgroundColor);
     bool hadClipping = p.hasClipping();
     QRegion oldRegion = p.clipRegion();
@@ -262,5 +253,18 @@
   return map;
 }
 
+
+QRegion KstPlotGroup::clipRegion() {
+  if (transparent()) {
+    // make the clipregion just the children
+    QRegion region;
+    for (KstViewObjectList::Iterator i = _children.begin(); i != _children.end(); ++i) {
+      region += (*i)->clipRegion();
+    }
+    return region;
+  }
+  return KstViewObject::clipRegion();
+}
+
 #include "kstplotgroup.moc"
 // vim: ts=2 sw=2 et
--- trunk/extragear/graphics/kst/kst/kstplotgroup.h #451065:451066
@@ -39,6 +39,8 @@
     void setTransparent(bool transparent);
     bool transparent() const;
     
+    virtual QRegion clipRegion();
+    
     virtual QMap<QString, QVariant> widgetHints(const QString& propertyName) const;
 
   public slots:


More information about the Kst mailing list