From bdffe51bade6b35e46bb5f78cb3be77c8310e4c7 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 28 Oct 2016 21:50:39 +0200 Subject: spline-widget: fix rounding bug introduced in a3b890b9b4 Since we're already adding snap_x/2, truncation is the correct choice here. --- spline-widget/spline-widget.cpp | 4 ++-- 1 file 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); } -- cgit v1.2.3