summaryrefslogtreecommitdiffhomepage
path: root/spline-widget
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2016-05-13 13:19:31 +0200
committerStanislaw Halik <sthalik@misaki.pl>2016-05-13 13:19:31 +0200
commit74d9f5e31428ef362033a63c10b781d943c5e5a5 (patch)
tree71e11ed620fa1d76577df07846e910970fe9210b /spline-widget
parent41a92ea7401c89c5696b3e1b2fa239458a92ff73 (diff)
many: remove unneeded implicit type conversion double <-> float
Diffstat (limited to 'spline-widget')
-rw-r--r--spline-widget/functionconfig.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/spline-widget/functionconfig.cpp b/spline-widget/functionconfig.cpp
index 777b4f6f..9fb5ea38 100644
--- a/spline-widget/functionconfig.cpp
+++ b/spline-widget/functionconfig.cpp
@@ -84,8 +84,8 @@ void Map::reload() {
auto& data = cur.data;
data = std::vector<float>(value_count);
- const int mult = precision();
- const int mult_ = mult * 30;
+ const float mult = precision();
+ const float mult_ = mult * 30;
const int sz = data.size();
@@ -112,24 +112,24 @@ void Map::reload() {
const float p0_y = p0.y(), p1_y = p1.y(), p2_y = p2.y(), p3_y = p3.y();
// multiplier helps fill in all the x's needed
- const int end = std::min<int>(sz, p2.x() * mult_);
- const int start = p1.x() * mult;
+ const int end = std::min<int>(sz, p2_x * mult_);
+ const int start = p1_x * mult;
for (int j = start; j < end; j++) {
const float t = (j - start) / (float) (end - start);
const float t2 = t*t;
const float t3 = t*t*t;
- const int x = .5 * ((2. * p1_x) +
+ const int x = .5f * ((2.f * p1_x) +
(-p0_x + p2_x) * t +
- (2. * p0_x - 5. * p1_x + 4. * p2_x - p3_x) * t2 +
- (-p0_x + 3. * p1_x - 3. * p2_x + p3_x) * t3)
+ (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)
* mult;
- const float y = .5 * ((2. * p1_y) +
+ const float y = .5f * ((2.f * p1_y) +
(-p0_y + p2_y) * t +
- (2. * p0_y - 5. * p1_y + 4. * p2_y - p3_y) * t2 +
- (-p0_y + 3. * p1_y - 3. * p2_y + p3_y) * t3);
+ (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);
if (x >= 0 && x < sz)
data[x] = y;