diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2016-10-28 21:50:39 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2016-10-28 21:50:39 +0200 |
commit | bdffe51bade6b35e46bb5f78cb3be77c8310e4c7 (patch) | |
tree | c43bcd7b861f9cb6e88fd26308ec6dcd77d4a0e6 /spline-widget | |
parent | 44d013da47b48952f73e678ba8d135724de316dd (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.cpp | 4 |
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); } |