From bce2db487b6beab0bcc7a6a5f16c2665670a89a9 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 14 May 2016 00:52:08 +0200 Subject: spline-widget: remove more float<->double conversions 74d9f5e31428ef362033a63c10b781d943c5e5a5 skipped some of intermediate computations. --- spline-widget/functionconfig.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'spline-widget/functionconfig.cpp') diff --git a/spline-widget/functionconfig.cpp b/spline-widget/functionconfig.cpp index 9fb5ea38..9807eac4 100644 --- a/spline-widget/functionconfig.cpp +++ b/spline-widget/functionconfig.cpp @@ -120,16 +120,16 @@ void Map::reload() { const float t2 = t*t; const float t3 = t*t*t; - const int x = .5f * ((2.f * p1_x) + + const int x = .5f * ((2 * p1_x) + (-p0_x + p2_x) * t + - (2.f * p0_x - 5.f * p1_x + 4.f * p2_x - p3_x) * t2 + - (-p0_x + 3.f * p1_x - 3.f * p2_x + p3_x) * t3) + (2 * p0_x - 5 * p1_x + 4.f * p2_x - p3_x) * t2 + + (-p0_x + 3 * p1_x - 3 * p2_x + p3_x) * t3) * mult; - const float y = .5f * ((2.f * p1_y) + + const float y = .5f * ((2 * p1_y) + (-p0_y + p2_y) * t + - (2. * p0_y - 5.f * p1_y + 4.f * p2_y - p3_y) * t2 + - (-p0_y + 3.f * p1_y - 3.f * p2_y + p3_y) * t3); + (2 * p0_y - 5 * p1_y + 4 * p2_y - p3_y) * t2 + + (-p0_y + 3 * p1_y - 3 * p2_y + p3_y) * t3); if (x >= 0 && x < sz) data[x] = y; -- cgit v1.2.3