[Kst] extragear/graphics/kst/kst

Barth Netterfield netterfield at astro.utoronto.ca
Tue Oct 25 05:19:48 CEST 2005


SVN commit 473946 by netterfield:

Fix a ylabel location regression.



 M  +1 -1      kst2dplot.cpp  
 M  +4 -2      kstplotlabel.cpp  


--- trunk/extragear/graphics/kst/kst/kst2dplot.cpp #473945:473946
@@ -5815,7 +5815,7 @@
 
   if (!_suppressLeft) {
     p.save();
-    p.translate((_yLabel->lineSpacing() - _yLabel->ascent())/2, (y_px - _yLabel->size().width()) / 2 - ytop_bdr_px);
+    p.translate((_yLabel->lineSpacing() - _yLabel->ascent())/2, (y_px - _yLabel->size().height()) / 2 - ytop_bdr_px/2);
     _yLabel->paint(p);
     p.restore();
   }
--- trunk/extragear/graphics/kst/kst/kstplotlabel.cpp #473945:473946
@@ -181,8 +181,10 @@
 
 
 QSize KstPlotLabel::size() const {
-  double r = fabs(_rotation*M_PI/180.0);
-  return QSize(d2i(_textWidth*cos(r) + _textHeight*sin(r)), d2i(_textHeight*cos(r) + _textWidth*sin(r)));
+  double sinr = fabs(sin(_rotation*M_PI/180.0));
+  double cosr = fabs(cos(_rotation*M_PI/180.0));
+  
+  return QSize(d2i(_textWidth*cosr + _textHeight*sinr), d2i(_textHeight*cosr + _textWidth*sinr));
 }
 
 


More information about the Kst mailing list