diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2016-05-14 00:52:08 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2016-05-14 00:52:08 +0200 |
commit | bce2db487b6beab0bcc7a6a5f16c2665670a89a9 (patch) | |
tree | 48677db0f2369c7ddd767d6a9ca52644283b0fda /spline-widget/functionconfig.cpp | |
parent | df2dc4503ce9ca4276a32925cfac49a3f26c4985 (diff) |
spline-widget: remove more float<->double conversions
74d9f5e31428ef362033a63c10b781d943c5e5a5 skipped some of intermediate
computations.
Diffstat (limited to 'spline-widget/functionconfig.cpp')
-rw-r--r-- | spline-widget/functionconfig.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
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; |