summaryrefslogtreecommitdiff
path: root/scene/resources/gradient.h
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-07-17 11:22:43 +0200
committerGitHub <noreply@github.com>2022-07-17 11:22:43 +0200
commit3953c1aa73bb0b4e96b3861dc83a380e7ce37da4 (patch)
treee36c6a330db4da8db98e5a206d548cf4e693d172 /scene/resources/gradient.h
parent4ce34366e1fdf54265a912717d05020619935c3d (diff)
parent039045d569618ec14ffc3a91b08566e48937e2ba (diff)
Merge pull request #63094 from Geometror/fix-gradient-cubic-interpolation
Diffstat (limited to 'scene/resources/gradient.h')
-rw-r--r--scene/resources/gradient.h8
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;