[Kst] extragear/graphics/kst/kst

Barth Netterfield netterfield at astro.utoronto.ca
Thu Dec 8 03:03:10 CET 2005


SVN commit 486516 by netterfield:

legends respect border width.



 M  +6 -5      kstviewlegend.cpp  


--- trunk/extragear/graphics/kst/kst/kstviewlegend.cpp #486515:486516
@@ -171,7 +171,7 @@
     for (KstBaseCurveList::Iterator it = Curves.begin(); it != Curves.end(); ++it) {
       p.save();
       if ((*it)->parsedLegendTag()) {
-        p.translate(_ascent/2, _ascent/4 + (i)*(rc.fontHeight()+_ascent/4));
+        p.translate(_ascent/2 + borderWidth() + padding(), _ascent/4 + borderWidth() + padding() + (i)*(rc.fontHeight()+_ascent/4));
         QRect symbolBound(QPoint(0,0),
                           QSize(16*_ascent/4, rc.fontHeight()));
 
@@ -187,7 +187,7 @@
     }
   } else {
     p.save();
-    p.translate(_ascent/2, _ascent/4);
+    p.translate(_ascent/2 + borderWidth() + padding(), _ascent/4 + borderWidth() + padding());
     for (KstBaseCurveList::Iterator it = Curves.begin(); it != Curves.end(); ++it) {
       if ((*it)->parsedLegendTag()) {
         QRect symbolBound(QPoint(0,0),
@@ -343,12 +343,13 @@
   height = _textHeight + _ascent/2;
 
   QSize sz(width, height);
+
   if (_parent) {
     QRect r(position(), sz);
-    resize(r.intersect(_parent->geometry()).size());
-  } else {
-    resize(sz);
+    sz = r.intersect(_parent->geometry()).size();
   }
+
+  resize(sz + QSize((borderWidth()+padding())*2, (borderWidth()+padding())*2));
 }
 
 


More information about the Kst mailing list