summaryrefslogtreecommitdiffhomepage
path: root/spline-widget
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2016-07-22 10:10:14 +0200
committerStanislaw Halik <sthalik@misaki.pl>2016-07-23 11:05:33 +0200
commitda71bbd53358160c2552fa17ec9fe2b5655822dd (patch)
tree614c0c8cc685812179295757285d323cdc696ad6 /spline-widget
parent8d428560bbcf2d5b96df406e3c6b7c5830571058 (diff)
spline-widget: round upward resulting position
Diffstat (limited to 'spline-widget')
-rw-r--r--spline-widget/qfunctionconfigurator.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/spline-widget/qfunctionconfigurator.cpp b/spline-widget/qfunctionconfigurator.cpp
index be6e9e88..6f08389f 100644
--- a/spline-widget/qfunctionconfigurator.cpp
+++ b/spline-widget/qfunctionconfigurator.cpp
@@ -436,8 +436,10 @@ QPointF QFunctionConfigurator::pixel_coord_to_point(const QPointF& point)
if (!_config)
return QPointF(-1, -1);
- qreal x = (point.x() - pixel_bounds.x()) / c.x();
- qreal y = (pixel_bounds.height() - point.y() + pixel_bounds.y()) / c.y();
+ using std::round;
+
+ qreal x = round((point.x() - pixel_bounds.x()) / c.x());
+ qreal y = round((pixel_bounds.height() - point.y() + pixel_bounds.y()) / c.y());
if (snap_x > 0)
x -= int(x) % snap_x;