[Kst] kdeextragear-2/kst/kst

Andrew Walker arwalker at sumusltd.com
Mon Aug 9 23:25:54 CEST 2004


CVS commit by arwalker: 

If we are in datamode and the mouse leaves and re-enters a plot at the same position, ensure that the same nearest data point is highlighted when the mouse re-enters.


  M +13 -11    kst2dplot.cpp   1.216


--- kdeextragear-2/kst/kst/kst2dplot.cpp  #1.215:1.216
@@ -1359,4 +1359,5 @@ void Kst2DPlot::paint(KstPaintType type,
     // we might need to redraw the datamode marker...
     //
+    if (!_highlighting) {
     KstTopLevelViewPtr tlv = KstApp::inst()->activeView();
     if (tlv) {
@@ -1364,9 +1365,8 @@ void Kst2DPlot::paint(KstPaintType type,
       if (view) {
         QPoint pos = view->mapFromGlobal(QCursor::pos());
-        if (view->findChildFor(pos) == KstViewObjectPtr(this) && GetPlotRegion().contains(pos)) {
           _copy_x = _copy_y = KST::NOPOINT;
-
+          if (view->findChildFor(pos) == KstViewObjectPtr(this) && GetPlotRegion().contains(pos)) {
           updateMousePos(pos);
-          if (KstApp::inst()->dataMode() && !_highlighting) {
+            if (KstApp::inst()->dataMode()) {
             highlightNearestDataPoint(false, view, pos);
           }
@@ -1375,4 +1375,5 @@ void Kst2DPlot::paint(KstPaintType type,
     }
   }
+  }
 
   KstPlotBase::paint(type, p);
@@ -2162,5 +2163,4 @@ void Kst2DPlot::highlightNearestDataPoin
 
     if (curve.data()) {
-      QString msg = i18n("%3 (%1, %2)").arg(newxpos).arg(newypos,0,'G').arg(curve->tagName());
       if (_copy_x != newxpos || _copy_y != newypos) {
         _copy_x = newxpos;
@@ -2173,4 +2173,6 @@ void Kst2DPlot::highlightNearestDataPoin
         p.setClipRegion(_lastClipRegion);
         drawDotAt(p, newxpos, newypos);
+
+        QString msg = i18n("%3 (%1, %2)").arg(newxpos).arg(newypos,0,'G').arg(curve->tagName());
         KstApp::inst()->slotUpdateDataMsg(msg);
       }





More information about the Kst mailing list