[Kst] [Bug 86505] Improvements to Plot dialog/Limits tab

Rick Chern rchern at interchange.ubc.ca
Sat Aug 21 22:08:26 CEST 2004


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
      
http://bugs.kde.org/show_bug.cgi?id=86505      
rchern interchange ubc ca changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED



------- Additional Comments From rchern interchange ubc ca  2004-08-21 22:08 -------
CVS commit by rchern: 

Use custom minor ticks in log mode as well.  Replaces original automatic behaviour.

CCMAIL: 86505-done bugs kde org


  M +40 -47    kst2dplot.cpp   1.240


--- kdeextragear-2/kst/kst/kst2dplot.cpp  #1.239:1.240
 @ -4503,7 +4503,6  @ void Kst2DPlot::plotAxes(QPainter& p, QR
       }
       // draw minor ticks
-      if (XTick == 1.0) {
-        for (j = 0; j < _xMinorTicks; j++) {
-          X2 = log10((double)j / ((double)_xMinorTicks) * 9.0 + 1.0) * (double)xtick_px + X1;
+      for (j = 1; j < _xMinorTicks; j++) {
+        X2 = log10((double)j/((double)_xMinorTicks)*(pow(10,XTick)-1.0)+1.0)/XTick * (double)xtick_px + X1;
           if (X2 > xleft_bdr_px && X2 < x_px - xright_bdr_px) {
             p.drawLine(d2i(X2),
 @ -4519,5 +4518,4  @ void Kst2DPlot::plotAxes(QPainter& p, QR
         }
       }
-    }
   } else {
     /* Draw X Ticks */
 @ -4564,7 +4562,6  @ void Kst2DPlot::plotAxes(QPainter& p, QR
                    d2i(Y1));
       }
-      if (YTick == 1.0) {
         for (j = 1; j < _yMinorTicks; j++) {
-          Y2 = (-log10((double)j / ((double)_yMinorTicks) * 9.0 + 1.0) + 1.0) * (double)ytick_px + Y1;
+        Y2 = (YTick -(log10((double)j/((double)_yMinorTicks)*(pow(10,YTick)-1.0)+1.0)/YTick)) * (double)ytick_px + Y1;
           if (Y2 > ytop_bdr_px && Y2 < y_px - ybot_bdr_px) {
             p.drawLine(d2i(xleft_bdr_px),
 @ -4579,5 +4576,4  @ void Kst2DPlot::plotAxes(QPainter& p, QR
         }
       }
-    }
   } else {
     i = (int)ceil( (double)_yMinorTicks * ( ytop_bdr_px - 1.0 - y_orig_px ) / ytick_px );
 @ -4696,7 +4692,6  @ void Kst2DPlot::plotGridLines(QPainter& 
       }
       // draw minor lines
-      if (XTick == 1.0) {
         for (j = 1; j < _xMinorTicks; j++) {
-          X2 = log10((double)j / ((double)_xMinorTicks) * 9.0 + 1.0) * (double)xtick_px + X1;
+        X2 = log10((double)j/((double)_xMinorTicks)*(pow(10,XTick)-1.0)+1.0)/XTick * (double)xtick_px + X1;
           if (_xMinorGrid && X2 > xleft_bdr_px && X2 < x_px - xright_bdr_px) {
             p.setPen(QPen(_minorGridColor, 0, Qt::DotLine));
 @ -4708,5 +4703,4  @ void Kst2DPlot::plotGridLines(QPainter& 
         }
       }
-    }
   } else {
     /* Draw X grid lines */
 @ -4743,7 +4737,7  @ void Kst2DPlot::plotGridLines(QPainter& 
                   d2i(Y1));
       }
-      if (YTick == 1.0) {
+      //draw minor lines
         for (j = 1; j < _yMinorTicks; j++) {
-          Y2 = (-log10((double)j / ((double)_yMinorTicks) * 9.0 + 1.0) + 1.0) * (double)ytick_px + Y1;
+        Y2 = YTick - (log10((double)j/((double)_yMinorTicks)*(pow(10,YTick)-1.0)+1.0)/YTick) * (double)ytick_px + Y1;
           if (_yMinorGrid && Y2 > ytop_bdr_px && Y2 < y_px - ybot_bdr_px) {
             p.setPen(QPen(_minorGridColor, 0, Qt::DotLine));
 @ -4755,5 +4749,4  @ void Kst2DPlot::plotGridLines(QPainter& 
         }
       }
-    }
   } else {
     i = (int)ceil( (double)_yMinorTicks * ( ytop_bdr_px - 1.0 - y_orig_px ) / ytick_px );



More information about the Kst mailing list