summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2016-07-04 10:36:24 +0200
committerStanislaw Halik <sthalik@misaki.pl>2016-07-04 10:36:24 +0200
commit1062fc7fac2a6f5e48cdc2e35d16f5e9673108f0 (patch)
tree47154c8c993c6d2204526d19c987c66db44ce001
parentee7530c39aaa769b7baea5fb4ece27786e04d521 (diff)
spline-widget: allow for closer points. fix fencepost error.
-rw-r--r--spline-widget/qfunctionconfigurator.cpp4
-rw-r--r--spline-widget/qfunctionconfigurator.h4
2 files changed, 4 insertions, 4 deletions
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;
};