mirror of
https://github.com/Ponce/slackbuilds
synced 2024-12-04 00:56:07 +01:00
88571d5b1d
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
29 lines
1.2 KiB
Diff
29 lines
1.2 KiB
Diff
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; i<n; ++i)
|
|
- if (curve->x((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;
|