[Kst] extragear/graphics/kst/src/libkstapp

Barth Netterfield netterfield at astro.utoronto.ca
Wed May 24 21:11:48 CEST 2006


SVN commit 544407 by netterfield:

cursor offset mode in data mode should offset from the nearest point
when 'c' is pressed, not from the cursor position.  This fixes that.



 M  +7 -2      kst2dplot.cpp  


--- trunk/extragear/graphics/kst/src/libkstapp/kst2dplot.cpp #544406:544407
@@ -3549,11 +3549,16 @@
     QString name;
     double xmin, ymin;
     double xmax, ymax;
+    double xpos, ypos;
 
     drawCursorPos(view);
-    getCursorPos(_mouse.tracker, _cursor_x, _cursor_y, xmin, xmax, ymin, ymax);
+    if (KstApp::inst()->dataMode()) {
+      getCursorPos(_mouse.tracker, xpos, ypos, xmin, xmax, ymin, ymax);
+      getNearestDataPoint(_mouse.tracker, name, _cursor_x, _cursor_y, xpos, ypos, xmin, xmax);
+    } else {
+      getCursorPos(_mouse.tracker, _cursor_x, _cursor_y, xmin, xmax, ymin, ymax);
+    }
     _cursorOffset = true;
-
     drawCursorPos(view);
   }
 }


More information about the Kst mailing list