[Kst] extragear/graphics/kst/kst

George Staikos staikos at kde.org
Fri Oct 7 22:47:47 CEST 2005


SVN commit 468367 by staikos:

x,y,top labels basically draw in the right place now


 M  +3 -3      kst2dplot.cpp  


--- trunk/extragear/graphics/kst/kst/kst2dplot.cpp #468366:468367
@@ -5741,14 +5741,14 @@
 void Kst2DPlot::plotLabels(QPainter &p, int x_px, int y_px, double xleft_bdr_px, double ytop_bdr_px) {
   if (!_suppressBottom) {
     p.save();
-    p.translate((x_px - _xLabel->size().width()) / 2, y_px);
+    p.translate((x_px - _xLabel->size().width()) / 2, y_px - _xLabel->size().height());
     _xLabel->paint(p);
     p.restore();
   }
 
   if (!_suppressLeft) {
     p.save();
-    p.translate((_yLabel->lineSpacing() - _yLabel->ascent())/2, y_px/2 + _yLabel->size().height());
+    p.translate((_yLabel->lineSpacing() - _yLabel->ascent())/2, (y_px - _yLabel->size().height()) / 2);
     _yLabel->paint(p);
     p.restore();
   }
@@ -5758,7 +5758,7 @@
     if (_xTransformed) {
       p.translate(d2i(xleft_bdr_px) - _topLabel->size().width() / 2, d2i(1.1 * _topLabel->lineSpacing()));
     } else {
-      p.translate(d2i(xleft_bdr_px) - _topLabel->size().width() / 2, d2i(0.95 * (ytop_bdr_px)));
+      p.translate((x_px - _topLabel->size().width()) / 2, 0);
     }
     _topLabel->paint(p);
     p.restore();


More information about the Kst mailing list