[Kst] extragear/graphics/kst/kst

Andrew Walker arwalker at sumusltd.com
Thu Nov 24 00:10:26 CET 2005


SVN commit 482735 by arwalker:

Explicitly set the rotation angle of the x-axis full label so that it is never drawn at 270 degrees. This problem arises because we are using the same variable for both the x-axis and y-axis full label.

 M  +10 -4     kst2dplot.cpp  


--- trunk/extragear/graphics/kst/kst/kst2dplot.cpp #482734:482735
@@ -2851,12 +2851,15 @@
   EscapeSpecialChars(ylabel);
   EscapeSpecialChars(toplabel);
 
-  if (xl)
+  if (xl) {
     _xLabel->setText(xlabel);
-  if (yl)
+  }
+  if (yl) {
     _yLabel->setText(ylabel);
-  if (tl)
+  }
+  if (tl) {
     _topLabel->setText(toplabel);
+  }
 }
 
 
@@ -5495,6 +5498,7 @@
     }
 
     if (tpx.delta && !tpx.labels.isEmpty()) {
+      _fullTickLabel->setRotation(0);
       _fullTickLabel->setText(tpx.labels[0]);
       p.save();
       p.translate(d2i(xleft_bdr_px), yTickPos+_xTickLabel->size().height());
@@ -5555,8 +5559,8 @@
   // y axis numbers
   if (!_suppressLeft) {
     if (tpy.delta && !tpy.labels.isEmpty()) {
+      _fullTickLabel->setRotation(270);
       _fullTickLabel->setText(tpy.labels[0]);
-      _fullTickLabel->setRotation(270);
       p.save();
       if (offsetY && !_yLabel->text().isEmpty()) {
         p.translate(_yLabel->lineSpacing(), d2i(y_px - ybot_bdr_px) - _fullTickLabel->size().height());
@@ -5567,6 +5571,7 @@
       p.restore();
       tpy.labels.pop_front();
     }
+    
     int xTickPos = d2i(xleft_bdr_px - _yTickLabel->lineSpacing() / 4);
     if (yTicksOutPlot()) {
       xTickPos -= d2i(2.0 * ytick_len_px);
@@ -5636,6 +5641,7 @@
     _yLabel->paint(p);
     p.restore();
   }
+  
   if (!_suppressTop) {
     p.save();
     if (_xTransformed) {


More information about the Kst mailing list