[Kst] [Bug 93548] Zero point value not aligned with major tick

Andrew Walker arwalker at sumusltd.com
Thu Dec 9 21:30:23 CET 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=93548        
arwalker sumusltd com changed:

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



------- Additional Comments From arwalker sumusltd com  2004-12-09 21:30 -------
CVS commit by arwalker: 

Fix problem with zero point offset.

CCMAIL: 93548-done bugs kde org


  M +10 -13    kst2dplot.cpp   1.305


--- kdeextragear-2/kst/kst/kst2dplot.cpp  #1.304:1.305
 @ -2035,5 +2035,5  @ void Kst2DPlot::draw(QPainter &p, KstPai
       d2i(x_px - xright_bdr_px - xleft_bdr_px + 1.0),
       d2i(y_px - ybot_bdr_px - ytop_bdr_px + 1.0));
-  QRect RelPlotAndAxisRegion(d2i(YLabel->lineSpacing(p) + 1),
+  QRect RelPlotAndAxisRegion(d2i(YLabel->lineSpacing(p) + 1.0),
                         d2i(ytop_bdr_px),
                         d2i(x_px - YLabel->lineSpacing(p) - xright_bdr_px),
 @ -2041,8 +2041,6  @ void Kst2DPlot::draw(QPainter &p, KstPai
   QRect RelWinRegion(0, 0, d2i(x_px), d2i(y_px));
 
-  x_orig_px = (tpx.org - x_min) / (x_max - x_min) *
-    double(RelPlotRegion.width()) + xleft_bdr_px;
-  y_orig_px = (y_max - tpy.org) / (y_max-y_min) * double(RelPlotRegion.height())
-    + ytop_bdr_px;
+  x_orig_px = (tpx.org - x_min) / (x_max - x_min) * double(RelPlotRegion.width()) + xleft_bdr_px;
+  y_orig_px = (y_max - tpy.org) / (y_max - y_min) * double(RelPlotRegion.height()) + ytop_bdr_px;
   xtick_px = (tpx.tick / (x_max - x_min)) * double(RelPlotRegion.width());
   ytick_px = (tpy.tick / (y_max - y_min)) * double(RelPlotRegion.height());
 @ -2055,6 +2053,6  @ void Kst2DPlot::draw(QPainter &p, KstPai
   // only attempt to draw if plot is big enough
   //
-  if (x_px - xright_bdr_px - xleft_bdr_px >= 10 &&
-      y_px - ybot_bdr_px - ytop_bdr_px + 1.0 - ytop_bdr_px >= 10) {
+  if (x_px - xright_bdr_px - xleft_bdr_px >= 10.0 &&
+      y_px - ybot_bdr_px - ytop_bdr_px + 1.0 - ytop_bdr_px >= 10.0) {
     Lx = RelPlotRegion.left();
     Hx = RelPlotRegion.right();
 @ -2064,5 +2062,5  @ void Kst2DPlot::draw(QPainter &p, KstPai
     m_Y = -double(RelPlotRegion.height())/(y_max - y_min);
     b_X = Lx - m_X * x_min;
-    b_Y = Hy - m_Y * y_min;
+    b_Y = Ly - m_Y * y_max;
     if (type != P_PRINT && type != P_EXPORT) {
       _m_X = m_X;
 @ -5315,6 +5312,6  @ void Kst2DPlot::plotCurves(QPainter& p,
         bool has_right = true;
         bool visible = true;
-        double drX, rX2=0.0;
-        int x0, y0, w, h;
+        double rX2 = 0.0;
+        double drX;
 
         if (c->barStyle() == 1) { // filled



More information about the Kst mailing list