diff --git a/libscidavis/src/RangeSelectorTool.cpp b/libscidavis/src/RangeSelectorTool.cpp index 26ce5fd..65bfa54 100644 --- a/libscidavis/src/RangeSelectorTool.cpp +++ b/libscidavis/src/RangeSelectorTool.cpp @@ -115,8 +115,8 @@ void RangeSelectorTool::pointSelected(const QPoint &pos) setActivePoint(point); else { // try to be intelligent about selecting the inactive point - double min_x = curve->minXValue(); - double max_x = curve->maxXValue(); + double min_x = minXValue(); + double max_x = maxXValue(); int n = curve->dataSize(); double second_x; if (curve->x(point) == min_x) @@ -129,11 +129,11 @@ void RangeSelectorTool::pointSelected(const QPoint &pos) second_x = min_x; if (second_x == max_x) { // start at selected point and try larger indices first for (int i=0; ix((i + point) % n) == max_x) + if (qFuzzyCompare(curve->x((i + point) % n), max_x)) d_inactive_point = (i + point) % n; } else { // start at selected point and try smaller indices first for (int i=n-1; i>=0; --i) - if (curve->x((i + point) % n) == max_x) + if (qFuzzyCompare(curve->x((i + point) % n),max_x)) d_inactive_point = (i + point) % n; } d_selected_curve = curve;