diff options
author | Hendrik Brucker <hendrik.brucker@mail.de> | 2022-07-17 03:46:27 +0200 |
---|---|---|
committer | Hendrik Brucker <hendrik.brucker@mail.de> | 2022-07-17 03:46:27 +0200 |
commit | 039045d569618ec14ffc3a91b08566e48937e2ba (patch) | |
tree | 62c47db1c8ca8754082ec0420d3ec72de1ad6aae /scene/resources | |
parent | e3a8ab68ce7497b3752d29965c6a54c50d548144 (diff) |
Fix cubic interpolation for Gradient
Diffstat (limited to 'scene/resources')
-rw-r--r-- | scene/resources/gradient.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/scene/resources/gradient.h b/scene/resources/gradient.h index 2b04ead0af..e4bac15e4b 100644 --- a/scene/resources/gradient.h +++ b/scene/resources/gradient.h @@ -157,10 +157,10 @@ public: const Point &pointP3 = points[p3]; float x = (p_offset - pointFirst.offset) / (pointSecond.offset - pointFirst.offset); - float r = Math::cubic_interpolate(pointP0.color.r, pointFirst.color.r, pointSecond.color.r, pointP3.color.r, x); - float g = Math::cubic_interpolate(pointP0.color.g, pointFirst.color.g, pointSecond.color.g, pointP3.color.g, x); - float b = Math::cubic_interpolate(pointP0.color.b, pointFirst.color.b, pointSecond.color.b, pointP3.color.b, x); - float a = Math::cubic_interpolate(pointP0.color.a, pointFirst.color.a, pointSecond.color.a, pointP3.color.a, x); + float r = Math::cubic_interpolate(pointFirst.color.r, pointSecond.color.r, pointP0.color.r, pointP3.color.r, x); + float g = Math::cubic_interpolate(pointFirst.color.g, pointSecond.color.g, pointP0.color.g, pointP3.color.g, x); + float b = Math::cubic_interpolate(pointFirst.color.b, pointSecond.color.b, pointP0.color.b, pointP3.color.b, x); + float a = Math::cubic_interpolate(pointFirst.color.a, pointSecond.color.a, pointP0.color.a, pointP3.color.a, x); return Color(r, g, b, a); } break; |