[Kst] kdeextragear-2/kst/kst

George Staikos staikos at kde.org
Mon Dec 20 02:20:25 CET 2004


CVS commit by staikos: 

Update the datamode marker when scrolling and zooming
BUG: 95413, 95412


  M +12 -5     kst2dplot.cpp   1.336
  M +2 -1      kst2dplot.h   1.130


--- kdeextragear-2/kst/kst/kst2dplot.cpp  #1.335:1.336
@@ -1956,8 +1956,8 @@ void Kst2DPlot::paint(KstPaintType type,
         if (view) {
           _copy_x = _copy_y = KST::NOPOINT;
-          if (GetPlotRegion().contains(_mouse.lastLocation)) {
-            updateMousePos(_mouse.lastLocation);
+          if (GetPlotRegion().contains(_mouse.tracker)) {
+            updateMousePos(_mouse.tracker);
             if (KstApp::inst()->dataMode()) {
-              highlightNearestDataPoint(false, view, _mouse.lastLocation);
+              highlightNearestDataPoint(false, view, _mouse.tracker);
             }
           }
@@ -2954,5 +2954,5 @@ bool Kst2DPlot::mouseHandler() const {
 
 void Kst2DPlot::removeFocus(QPainter& p) {
-  _mouse.lastLocation = QPoint(-1, -1);
+  _mouse.tracker = _mouse.lastLocation = QPoint(-1, -1);
   p.setClipRegion(_lastClipRegion);
   setHasFocus(false);
@@ -3159,4 +3159,6 @@ void Kst2DPlot::mouseMoveEvent(QWidget *
   }
 
+  _mouse.tracker = e->pos();
+
   if (globalZoomType() == LABEL_TOOL) { // HACK
     _mouse.mode = LABEL_TOOL;
@@ -3432,4 +3434,6 @@ void Kst2DPlot::mouseReleaseEvent(QWidge
   static_cast<KstViewWidget*>(view)->viewObject()->releaseMouse(this);
 
+  _mouse.tracker = e->pos();
+
   QRect newg = _mouse.mouseRect();
   if (_mouse.mode == XY_ZOOMBOX) {
@@ -3574,4 +3578,5 @@ KstMouse::KstMouse()
   minMove = 2;
   lastLocation = QPoint(-1, -1);
+  tracker = QPoint(-1, -1);
 }
 
@@ -3638,5 +3643,5 @@ void Kst2DPlot::zoomRectUpdate(QWidget *
 void Kst2DPlot::setCursorForMode(QWidget *view) {
   Q_ASSERT(false);
-  setCursorForMode(view, _mouse.mode, _mouse.lastLocation);
+  setCursorForMode(view, _mouse.mode, _mouse.tracker);
 }
 
@@ -4588,4 +4593,6 @@ void Kst2DPlot::dropEvent(QWidget *view,
   }
 
+  _mouse.tracker = e->pos();
+
   if (accept) {
     KstApp::inst()->document()->setModified();

--- kdeextragear-2/kst/kst/kst2dplot.h  #1.129:1.130
@@ -61,5 +61,6 @@ struct KstMouse {
   KstMouseModeType mode;
   int label, minMove;
-  QPoint lastLocation, pressLocation;
+  QPoint lastLocation, pressLocation;  // for zooming primarily
+  QPoint tracker; // for tracking the mouse location
   QRect plotGeometry;
   bool zooming() const;





More information about the Kst mailing list