From 1062fc7fac2a6f5e48cdc2e35d16f5e9673108f0 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 4 Jul 2016 10:36:24 +0200 Subject: spline-widget: allow for closer points. fix fencepost error. --- spline-widget/qfunctionconfigurator.cpp | 4 ++-- spline-widget/qfunctionconfigurator.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'spline-widget') diff --git a/spline-widget/qfunctionconfigurator.cpp b/spline-widget/qfunctionconfigurator.cpp index ec6a331e..be6e9e88 100644 --- a/spline-widget/qfunctionconfigurator.cpp +++ b/spline-widget/qfunctionconfigurator.cpp @@ -335,7 +335,7 @@ void QFunctionConfigurator::mouseMoveEvent(QMouseEvent *e) bad = pix.x() + point_closeness_limit > other_pix.x(); if (i == 0 && bad) { - pix.setX(other_pix.x() - point_closeness_limit - 1); + pix.setX(other_pix.x() - point_closeness_limit); new_pt = pixel_coord_to_point(pix); } else @@ -348,7 +348,7 @@ void QFunctionConfigurator::mouseMoveEvent(QMouseEvent *e) bad = pix.x() - point_closeness_limit < other_pix.x(); if (i == 0 && bad) { - pix.setX(other_pix.x() + point_closeness_limit + 1); + pix.setX(other_pix.x() + point_closeness_limit); new_pt = pixel_coord_to_point(pix); } else diff --git a/spline-widget/qfunctionconfigurator.h b/spline-widget/qfunctionconfigurator.h index 1700dfca..b1cf7afc 100644 --- a/spline-widget/qfunctionconfigurator.h +++ b/spline-widget/qfunctionconfigurator.h @@ -79,6 +79,6 @@ private: bool _draw_function, _preview_only; static constexpr int line_length_pixels = 3; - static constexpr int point_size = 5; - static constexpr int point_closeness_limit = 12; + static constexpr int point_size = 4; + static constexpr int point_closeness_limit = 5; }; -- cgit v1.2.3