diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-08-31 08:37:12 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-31 08:37:12 +0200 |
commit | 96b470b28ed2e3c7294368506dae95dee0b1f288 (patch) | |
tree | a81d0d7cf431421fc7365cdf5406252da3f9ccfe /editor/plugins | |
parent | 9d2e2c97c0887c2aec110f82a8a55b57525452cb (diff) | |
parent | ae18928748047413db4d405a5d79a4bbfca05aca (diff) |
Merge pull request #63394 from Calinou/curve-gradient-rename-interpolate
Rename Curve/Curve2D/Curve3D/Gradient `interpolate()` to `sample()`
Diffstat (limited to 'editor/plugins')
-rw-r--r-- | editor/plugins/curve_editor_plugin.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/editor/plugins/curve_editor_plugin.cpp b/editor/plugins/curve_editor_plugin.cpp index 9a31263f9a..0e84381279 100644 --- a/editor/plugins/curve_editor_plugin.cpp +++ b/editor/plugins/curve_editor_plugin.cpp @@ -579,7 +579,7 @@ template <typename T> static void plot_curve_accurate(const Curve &curve, float step, T plot_func) { if (curve.get_point_count() <= 1) { // Not enough points to make a curve, so it's just a straight line - float y = curve.interpolate(0); + float y = curve.sample(0); plot_func(Vector2(0, y), Vector2(1.f, y), true); } else { @@ -603,7 +603,7 @@ static void plot_curve_accurate(const Curve &curve, float step, T plot_func) { for (float x = step; x < len; x += step) { pos.x = a.x + x; - pos.y = curve.interpolate_local_nocheck(i - 1, x); + pos.y = curve.sample_local_nocheck(i - 1, x); plot_func(prev_pos, pos, true); prev_pos = pos; } @@ -817,7 +817,7 @@ Ref<Texture2D> CurvePreviewGenerator::generate(const Ref<Resource> &p_from, cons int prev_y = 0; for (int x = 0; x < im.get_width(); ++x) { float t = static_cast<float>(x) / im.get_width(); - float v = (curve.interpolate_baked(t) - curve.get_min_value()) / range_y; + float v = (curve.sample_baked(t) - curve.get_min_value()) / range_y; int y = CLAMP(im.get_height() - v * im.get_height(), 0, im.get_height()); // Plot point |