[Kst] extragear/graphics/kst/kst

Andrew Walker arwalker at sumusltd.com
Wed Dec 7 02:01:19 CET 2005


SVN commit 486183 by arwalker:

make sure that the curve dialog is also launched when clicking near a curve when one or more axes is reversed

 M  +4 -14     kst2dplot.cpp  


--- trunk/extragear/graphics/kst/kst/kst2dplot.cpp #486182:486183
@@ -5982,22 +5982,12 @@
   QPoint pos = e->pos();
   double best_distance = 1.0E300;
   double xmin, ymin, xmax, ymax;
-  getLScale(xmin, ymin, xmax, ymax);
+  double xpos, ypos;
+  
+  getCursorPos(pos, xpos, ypos, xmin, xmax, ymin, ymax);
 
-  // find mouse location in plot units
-  double xpos = double(pos.x() - pr.left())/double(pr.width()) * (xmax - xmin) + xmin;
-  if (isXLog()) {
-    xpos = pow(10.0, xpos);
-  }
-
-  double ypos = double(pos.y() - pr.top()) / double(pr.height()) * (ymin - ymax) + ymax;
-
-  if (isYLog()) {
-    ypos = pow(10.0, ypos);
-  }
-
   // convert 1 pixel to plot units.
-  double dx_per_pix = double(pos.x()+2 - pr.left()) / double(pr.width()) * (xmax - xmin) + xmin;
+  double dx_per_pix = double(pos.x() + 2 - pr.left()) / double(pr.width()) * (xmax - xmin) + xmin;
   if (isXLog()) {
     dx_per_pix = pow(10.0, dx_per_pix);
   }


More information about the Kst mailing list