[Kst] kdeextragear-2/kst/kst

George Staikos staikos at kde.org
Thu Nov 13 22:29:41 CET 2003


CVS commit by staikos: 

Don't crash in data mode, do data mode properly in non-log mode
- took a chapter from the overcomplication book here it seems, resulting in a
  very difficult bug to track down

CCMAIL: 68041-done at bugs.kde.org


  M +4 -2      kstequationcurve.cpp   1.38
  M +1 -5      kstview.cpp   1.56


--- kdeextragear-2/kst/kst/kstequationcurve.cpp  #1.37:1.38
@@ -207,6 +207,8 @@ KstObject::UpdateType KstEquationCurve::
 // FIXME: Optimize me, especially map lookups.
 void KstEquationCurve::getPoint(int i, double &x, double &y) {
-  x = _inputVectors[XVECTOR]->interpolate(i, NS);
-  y = _outputVectors[OUTVECTOR]->value()[i];
+  KstVectorPtr xv = _inputVectors[XVECTOR];
+  KstVectorPtr yv = _outputVectors[OUTVECTOR];
+  x = xv->interpolate(i, NS);
+  y = yv->value()[i];
 }
 

--- kdeextragear-2/kst/kst/kstview.cpp  #1.55:1.56
@@ -405,9 +405,5 @@ void KstView::updateMouse() {
       for (KstBaseCurveList::Iterator i = pPlot->Curves.begin(); i != pPlot->Curves.end(); ++i) {
         double xpt = 0.0, ypt = 0.0;
-        if (pPlot->isXLog()) {
           (*i)->getPoint((*i)->sampleCount() * xpos / ((*i)->maxX() - (*i)->minX()), xpt, ypt);
-        } else {
-          (*i)->getPoint(xpos, xpt, ypt);
-        }
         if (fabs(ypos - ypt) < delta) {
           delta = fabs(ypos - ypt);





More information about the Kst mailing list