[Kst] kdeextragear-2/kst/kst

George Staikos staikos at kde.org
Fri Jun 4 01:28:07 CEST 2004


CVS commit by staikos: 

labels are editable again


  M +11 -2     kst2dplot.cpp   1.52
  M +2 -2      kstlabel.h   1.21


--- kdeextragear-2/kst/kst/kst2dplot.cpp  #1.51:1.52
@@ -1813,5 +1813,5 @@ void Kst2DPlot::mouseMoveEvent(QWidget *
     }
     iHeight = rectBounding.height();
-    if (GetWinRegion().height() < iHeight ) {
+    if (GetWinRegion().height() < iHeight) {
       iHeight = GetWinRegion().height();
     }
@@ -2106,5 +2106,14 @@ void Kst2DPlot::mouseReleaseEvent(QWidge
     }
   } else if (_mouse.mode == LABEL_TOOL) {
-    int i_label = _mouse.label;
+    int i_label = -1;
+    uint cnt = labelList.count();
+    QPoint pt = GetWinRegion().topLeft();
+    QPoint ptCheck(e->x() - pt.x(), e->y() - pt.y());
+    for (uint i = 0; i < cnt; ++i) {
+      if (labelList.at(i)->extents.contains(ptCheck)) {
+        i_label = i;
+        break;
+      }
+    }
 
     plotregion = GetPlotRegion();

--- kdeextragear-2/kst/kst/kstlabel.h  #1.20:1.21
@@ -76,6 +76,6 @@ public:
   void setDoScalarReplacement(bool in_do);
 
-  inline double x() const {return _x;}
-  inline double y() const {return _y;}
+  inline double x() const { return _x; }
+  inline double y() const { return _y; }
 
   QRegion extents;





More information about the Kst mailing list