summaryrefslogtreecommitdiffhomepage
path: root/spline
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2017-05-07 08:09:39 +0200
committerStanislaw Halik <sthalik@misaki.pl>2017-05-10 11:19:22 +0200
commit6ccd173d52f639bf95d82760fb9c3c1943b660d1 (patch)
treec00a9056f807f69a536e0c53bd0a6f93c7ca0ee0 /spline
parentebc24a6ab8bbf25620b2f524e94106e9f50cc86d (diff)
spline: fix points deleting themselves on dragging to origin
Diffstat (limited to 'spline')
-rw-r--r--spline/spline.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/spline/spline.cpp b/spline/spline.cpp
index 277ab407..3787e0f9 100644
--- a/spline/spline.cpp
+++ b/spline/spline.cpp
@@ -405,8 +405,9 @@ void spline::recompute()
for (int j = 0; j < i; j++)
{
const QPointF& pt2(list[j]);
- const double dist_sq = QPointF::dotProduct(pt, pt2);
- const double overlap = max_x / 360.;
+ const QPointF tmp(pt - pt2);
+ const double dist_sq = QPointF::dotProduct(tmp, tmp);
+ const double overlap = max_x / 500.;
if (dist_sq < overlap * overlap)
return true;
}