Skip to content

Commit 6f88168

Browse files
committed
[cpp] Fixes and closes #2886.
The user submitted code that fixes the incorrect tinting on spine-cpp 4.2. I tested this fix using spine-glfw to confirm the existence of the issue and the fix.
1 parent d698e53 commit 6f88168

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

spine-cpp/spine-cpp/src/spine/ColorTimeline.cpp

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -453,16 +453,11 @@ void RGB2Timeline::apply(Skeleton &skeleton, float lastTime, float time, Vector<
453453
}
454454
default: {
455455
r = getBezierValue(time, i, RGB2Timeline::R, curveType - RGB2Timeline::BEZIER);
456-
g = getBezierValue(time, i, RGB2Timeline::G,
457-
curveType + RGB2Timeline::BEZIER_SIZE - RGB2Timeline::BEZIER);
458-
b = getBezierValue(time, i, RGB2Timeline::B,
459-
curveType + RGB2Timeline::BEZIER_SIZE * 2 - RGB2Timeline::BEZIER);
460-
r2 = getBezierValue(time, i, RGB2Timeline::R2,
461-
curveType + RGB2Timeline::BEZIER_SIZE * 4 - RGB2Timeline::BEZIER);
462-
g2 = getBezierValue(time, i, RGB2Timeline::G2,
463-
curveType + RGB2Timeline::BEZIER_SIZE * 5 - RGB2Timeline::BEZIER);
464-
b2 = getBezierValue(time, i, RGB2Timeline::B2,
465-
curveType + RGB2Timeline::BEZIER_SIZE * 6 - RGB2Timeline::BEZIER);
456+
g = getBezierValue(time, i, RGB2Timeline::G, curveType + RGB2Timeline::BEZIER_SIZE - RGB2Timeline::BEZIER);
457+
b = getBezierValue(time, i, RGB2Timeline::B, curveType + RGB2Timeline::BEZIER_SIZE * 2 - RGB2Timeline::BEZIER);
458+
r2 = getBezierValue(time, i, RGB2Timeline::R2, curveType + RGB2Timeline::BEZIER_SIZE * 3 - RGB2Timeline::BEZIER);
459+
g2 = getBezierValue(time, i, RGB2Timeline::G2, curveType + RGB2Timeline::BEZIER_SIZE * 4 - RGB2Timeline::BEZIER);
460+
b2 = getBezierValue(time, i, RGB2Timeline::B2, curveType + RGB2Timeline::BEZIER_SIZE * 5 - RGB2Timeline::BEZIER);
466461
}
467462
}
468463
Color &light = slot->_color, &dark = slot->_darkColor;

0 commit comments

Comments
 (0)