summaryrefslogtreecommitdiffhomepage
path: root/spline-widget
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2016-10-28 21:50:39 +0200
committerStanislaw Halik <sthalik@misaki.pl>2016-10-28 21:50:39 +0200
commitbdffe51bade6b35e46bb5f78cb3be77c8310e4c7 (patch)
treec43bcd7b861f9cb6e88fd26308ec6dcd77d4a0e6 /spline-widget
parent44d013da47b48952f73e678ba8d135724de316dd (diff)
spline-widget: fix rounding bug introduced in a3b890b9b4opentrack-2.3-rc99p14
Since we're already adding snap_x/2, truncation is the correct choice here.
Diffstat (limited to 'spline-widget')
-rw-r--r--spline-widget/spline-widget.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/spline-widget/spline-widget.cpp b/spline-widget/spline-widget.cpp
index e68ff4a6..762c63d7 100644
--- a/spline-widget/spline-widget.cpp
+++ b/spline-widget/spline-widget.cpp
@@ -545,14 +545,14 @@ QPointF spline_widget::pixel_coord_to_point(const QPoint& point)
{
x += snap_x / 2.;
x -= std::fmod(x, snap_x);
- const volatile int x_ = iround(x * c);
+ const volatile int x_ = int(x * c);
x = x_ / double(c);
}
if (snap_y > 0)
{
y += snap_y / 2.;
y -= std::fmod(y, snap_y);
- const volatile int y_ = iround(y * c);
+ const volatile int y_ = int(y * c);
y = y_ / double(c);
}